pillow 13.0.0
- Source
- https://github.com/python-pillow/Pillow
- Tag scanned
13.0.0- Compared with
12.3.0(4 signals introduced since)- Files
- 600 scanned, 1156 skipped (binary, oversized, or unrecognised)
- Signals
- 0 critical · 0 warn · 61 info
- Scan time
- 40.4 s
- LLM review
- Reviewed by claude-haiku-5-5 (Anthropic): 56 of 56 warn and critical signals; 56 demoted to info.
- Disclude version
- 4.0.0
- Scanned (UTC)
- 2026-10-17 14:41
Signals
Ordered by severity, then signals introduced in this release. Hidden characters are shown as ⟨U+…⟩.
-
b b ), # 16x16 strip with duplicatedlikely benign Base64-encoded test image data embedded in a libtiff test file.Reasoning
The base64-like blob is a short literal of raw pixel test data inside a unit test for libtiff. It is a fixture, not a hidden payload, and the raw pass has a high false-positive rate for this kind of content.
-
info
warn→ info by reviewidentifier-confusable-collisionsrc/libImaging/Draw.c:248:9new in this releaseint x1, int y1, int ink, point_handler point,dismissed Coordinate parameters in a line-drawing function flagged by the confusability heuristic.Reasoning
y1 and similar short coordinate names are ordinary in a drawing routine; the collision is a heuristic artifact.
-
info
warn→ info by reviewidentifier-confusable-collisionsrc/libImaging/Mode.c:150:6new in this release= , = , = , = ,likely benign Pillow L-mode raw-mode mapping table whose names collide visually.Reasoning
The entries are a mapping table of Pillow L-mode raw modes (L;1, L;2, L;2I, L;16B). The collision is between legitimately distinct names that differ by I versus 1 or by a digit. This is a naming artifact, not obfuscation.
-
info
warn→ info by reviewidentifier-confusable-collisionsrc/libImaging/Mode.h:148:5new in this releaseIMAGING_RAWMODE_LX, IMAGING_RAWMODE_L_1, IMAGING_RAWMODE_L_16, IMAGING_RAWMODE_L_16B,likely benign Pillow L-mode rawmode enum constants with confusable-looking names.Reasoning
The snippet lists Pillow L-mode rawmode enum constants (IMAGING_RAWMODE_L_1, L_16, L_16B). The skeleton match comes from legitimate distinct names, a common false positive for this rule.
-
=likely benign Concatenated bytes literal encoding a synthetic TIFF file for a metadata test.Reasoning
The bytes literal is a hand-built TIFF header and IFD used as an in-memory BytesIO fixture for metadata parsing tests. The escapes are binary test data, which is expected in this context.
-
=likely benign Pickled PIL PngImageFile bytes used as a fixture in a pickle round-trip test.Reasoning
The bytes are a pickle stream of a PIL PngImageFile, passed to pickle.loads in a test of pickling image objects. Loading a fixed, trusted test fixture is normal here, though pickle loading is a known risk pattern in general.
-
if ; then LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_AOM=SYSTEM) HAS_ENCODER=1 -
if ; then LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_DAV1D=SYSTEM) HAS_DECODER=1 -
if ; then LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_LIBGAV1=SYSTEM) HAS_DECODER=1 -
if ; then LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_RAV1E=SYSTEM) HAS_ENCODER=1 -
if ; then LIBAVIF_CMAKE_FLAGS+=(-DAVIF_CODEC_SVT=SYSTEM) HAS_ENCODER=1 -
}: =likely benign Build-script lookup of a library root through globals() combined with environment variables.Reasoning
The code looks up a root module by name in globals() and then checks os.environ, which matches the build script's logic for locating optional library roots from environment variables. It is a build-configuration lookup with a fixed set of names.
-
=likely benign Module-level constants are populated from a static COMPRESSIONS table via vars().Reasoning
The loop writes compression constants from the COMPRESSIONS dict into module globals via vars(), which is a common way to define named constants from a table. The keys are fixed, so nothing is dynamically or maliciously determined.
-
likely benign Base64-encoded PNG sample embedded in a docstring.
Reasoning
The base64 blob is a PNG image embedded in a docstring example for ImageFont. The raw-pass encoding signal is expected for an embedded sample image and has no execution path.
-
=likely benign Restricted eval-mode compilation of ImageMath expressions, followed by a code-safety scan.Reasoning
ImageMath deliberately compiles user expressions in eval mode and runs a scan() over the compiled code to restrict allowed names and operations. This is a restricted expression evaluator, which is legitimate, though compile on a non-literal is still a sensitive pattern.
-
# nosec return 1likely benign Image viewer launch through os.system using a command built from the image path.Reasoning
os.system runs the external image viewer command built by get_command for the file being shown. This is the expected viewer-launch mechanism, with a nosec marker. The command is not attacker-controlled in normal use, but the non-literal shell call warrants a look at how path is sanitized.
-
= =likely benign FlateDecode stream decompression in the PDF parser.Reasoning
zlib.decompressobj is used to decode FlateDecode streams inside a PDF parser, with max_length bounding the output. This is the standard PDF filter handling for legitimate documents.
-
= rb = rb = rb = rblikely benign Octal escapes defining PDF delimiter and whitespace character classes in a regex.Reasoning
The escapes are octal character codes inside regex character classes for PDF whitespace and delimiter sets. This is ordinary regex syntax, not obfuscation.
-
= rb = rb = rb = + blikely benign Octal escapes in a PDF delimiter regex character class.Reasoning
The escapes are octal character codes in a regex character class for PDF delimiter and whitespace sets, matching the PDF spec. This is ordinary regex syntax.
-
= rb = rb = + b = + blikely benign Octal escapes in a PDF whitespace regex character class.Reasoning
The escapes are octal character codes in a regex character class for PDF whitespace. This is ordinary regex syntax from the PDF spec.
-
= =likely benign Size-bounded zlib decompression of PNG text chunk data.Reasoning
The helper decompresses PNG text chunks with zlib.decompressobj and caps the output at MAX_TEXT_CHUNK. The size limit is a defensive measure against decompression bombs, so this is safe handling.
-
# default palette taken from piffo 0.93 by Hans Häggström b b blikely benign Default 256-color palette embedded as a bytes literal in the WAL image reader.Reasoning
The byte literal is the default Quake WAL palette, a 768-byte color table with a cited source (piffo). Binary constant data in an image library is expected.
-
b b b blikely benign Continuation of the default palette byte table.Reasoning
Raw hex escapes in this file are the palette data continuing; it is a legitimate constant table and the entropy is typical of palette values, not an encoded payload.
-
b b b blikely benign Further rows of the default WAL palette constant.Reasoning
Same palette table; the values are smooth, monotonic color ramps, consistent with a real palette rather than hidden code.
-
b b b blikely benign Palette data rows within the WAL default palette.Reasoning
Palette data rows within the same legitimate constant table.
-
b b b blikely benign Palette data continuation in WalImageFile.py.Reasoning
Palette data continuation; no execution or decoding of this data occurs in the snippet.
-
b b b blikely benign Palette rows in the WAL default color table.Reasoning
Palette rows with a regular descending pattern, consistent with a color table.
-
b b b )likely benign Tail of the default WAL palette bytes literal.Reasoning
End of the palette constant; closing paren of a bytes literal with no decoding or execution.
-
b b )likely benign Final palette row of the WAL default color table.Reasoning
Final palette row; legitimate constant data.
-
return Truelikely benign Feature-detection helper importing optional PIL dependency modules by name.Reasoning
Pillow's check_module uses __import__ on a module name parameter to test whether optional dependencies are installed. The module names come from internal code, not untrusted input, so this is a standard feature-detection pattern.
-
returnlikely benign Imports an optional dependency to read its version string.Reasoning
Version lookup helper imports a known optional library by name and reads its version attribute; the names are internal constants, consistent with Pillow's features module.
-
= returnlikely benign Imports an optional module to check for a feature flag attribute.Reasoning
Dynamic import of a module name passed internally to check a feature flag attribute, matching Pillow's normal optional-dependency probing.
-
returnlikely benign Imports an optional dependency to read its version.Reasoning
Same version-lookup helper pattern as earlier in the file, importing known optional packages by internal name.
-
; func = ; iflikely benign Runtime resolution of Tk library function pointers via dlsym.Reasoning
tkImaging loads Tk stub functions by name via dlsym from a library handle, a known pattern for resolving Tk symbols at runtime. The names are internal constants, not attacker-controlled, though the non-literal argument is what triggers the signal.
-
/* Try loading from the main program namespace first */ main_program = ; iflikely benign dlopen of the main program handle to locate Tk symbols.Reasoning
Loads from the main program namespace via dlopen(NULL) and closes the handle, a standard way to find already-linked Tk symbols; no attacker-controlled path is visible.
-
} tkinter_lib = ; iflikely benign dlopen of the tkinter module library located at runtime, as Pillow does for Tk image support.Reasoning
Pillow's tkImaging.c dlopens the tkinter shared library whose path is computed from the Tk/Python installation at runtime. This is a standard, legitimate pattern for locating a module file; the snippet shows an error message consistent with that purpose.
-
static struct ImagingAccessInstance accessors =dismissed Pillow mode-constant identifiers flagged for visual similarity in a normal accessor table.Reasoning
IMAGING_MODE_1 and IMAGING_MODE_L collapse to a skeleton with IMAGING_MODE_ names because of the uppercase letter set (I, L, O). These are ordinary macro names from Pillow's image mode constants, and the collision comes from the identifier-skeleton heuristic, not from any actual confusable substitution.
-
if else ifdismissed Standard image-mode constant comparisons in a conversion routine.Reasoning
Comparisons against IMAGING_MODE_1 and IMAGING_MODE_L are ordinary uppercase mode constants; the skeleton collision is a false positive from the heuristic treating I/L/O as confusable.
-
int d; int x0, y0; int xmin, ymin, xmax, ymax; float dx;dismissed Short coordinate variables in a line-drawing routine flagged for visual similarity.Reasoning
xo and yo are ordinary coordinate variable names (x0/xo, y0/yo style in line-drawing code). Short names like these collide under the skeleton heuristic and carry no obfuscation intent.
-
int d; int x0, y0; int xmin, ymin, xmax, ymax; float dx;dismissed Coordinate variable names in a drawing routine flagged by the confusability heuristic.Reasoning
Same as the previous finding: ymin/ymax-style coordinate names trigger the confusable heuristic on common short identifiers in standard graphics code.
-
static inline voiddismissed Coordinate parameters in a horizontal line drawing helper.Reasoning
x0 and y0 are common coordinate parameter names; the skeleton collision reflects the digit-zero/letter-O ambiguity in short names, a false positive.
-
int32_t py, pl, pr; int32_t cy, cl, cr; int8_t bufcnt; int8_t finished;dismissed Short scanline state arrays in a polygon/fill routine flagged for similarity.Reasoning
cy, cl, cr are arrays of scanline state; the collision with another short name is incidental to the heuristic and reflects no obfuscation.
-
voiddismissed Angle parameters in a normalization helper flagged by the confusable heuristic.Reasoning
al and ar are angle parameters in a standard normalize function; the skeleton collision is a false positive on short names.
-
ifdismissed Image mode validation in a fill routine flagged for identifier similarity.Reasoning
Mode comparisons against IMAGING_MODE_* constants are ordinary validation code; the skeleton collision is from uppercase letters.
-
Imaging imIn, int x0, int y0, int x1,dismissed Coordinate parameters in a geometry function flagged for similarity.Reasoning
x0/x1-style coordinate parameters in a geometry transform are standard; the collision is a heuristic false positive.
-
int x0, int y0, int x1, int y1,dismissed Coordinate parameters in a geometry function flagged for similarity.Reasoning
y0/y1 coordinate parameters in a geometry function are ordinary; the skeleton collision is spurious.
-
likely benign Portability macro mapping FLOAT32 to the float type in Pillow's platform header.
Reasoning
Pillow's ImPlatform.h defines FLOAT32 as float for portable typedef-style aliasing of fixed-width float types across platforms. This is a well-known legitimate portability idiom, not an attempt to hide malicious code.
-
likely benign Portability macro mapping FLOAT64 to the double type in Pillow's platform header.
Reasoning
Same portability idiom as FLOAT32: FLOAT64 mapped to double in Pillow's platform header for consistent type naming.
-
= , = , = , = , = , = ,dismissed Image mode name lookup table flagged for identifier similarity.Reasoning
Mode name table entries for IMAGING_MODE_* constants; the skeleton collision is caused by uppercase letters in ordinary identifiers.
-
= , = , = ,dismissed Raw mode name lookup table flagged for identifier similarity.Reasoning
RAWMODE name table entries are standard designated-initializer data; the collision is a heuristic false positive.
-
= , = , = ,likely benign Table of Pillow raw-mode identifier-to-string mappings with names that differ only in confusable characters like 1 and I.Reasoning
This is a static table of Pillow raw-mode names such as IMAGING_RAWMODE_1_8 and IMAGING_RAWMODE_1_I. The skeleton collision comes from the legitimate names 1 and I, which are distinct mode identifiers for different bit depths. Token-pass confusable heuristics fire on such names routinely, and nothing here is executable or encoded.
-
IMAGING_MODE_1, IMAGING_MODE_CMYK, IMAGING_MODE_F,likely benign Pillow image-mode enum declaration with visually similar identifiers.Reasoning
This is a C enum of Pillow image modes (IMAGING_MODE_1, IMAGING_MODE_CMYK, IMAGING_MODE_F). The skeleton collision reflects the distinct, meaningful names IMAGING_MODE_1 and IMAGING_MODE_I, which is normal for a header.
-
// Non-rawmode aliases. IMAGING_RAWMODE_1, IMAGING_RAWMODE_CMYK, IMAGING_RAWMODE_F,likely benign Pillow rawmode alias enum with confusable-looking identifier names.Reasoning
This is an enum block of Pillow rawmode aliases. The flagged names are distinct legitimate identifiers whose letters and digits look alike, so the confusable heuristic fires on ordinary code.
-
// Rawmodes IMAGING_RAWMODE_1_8, IMAGING_RAWMODE_1_I, IMAGING_RAWMODE_1_IR,likely benign Pillow rawmode enum constants whose names collide under confusable folding.Reasoning
The snippet lists Pillow rawmode enum constants (IMAGING_RAWMODE_1_8, _1_I, _1_IR). Their differences are legitimate suffixes; the collision is a heuristic artifact of the digit 1 and letter I.
-
/* bilevel */ , , ,likely benign Pillow pack-function dispatch table for bilevel modes.Reasoning
This is a Pillow pack-table row using IMAGING_MODE_1 and IMAGING_RAWMODE_1_I with pack functions. The collision reflects distinct legitimate identifiers. The code is ordinary image packing logic.
-
/* bilevel */ , , ,likely benign Pillow bilevel pack-dispatch table entry with confusable-looking rawmode names.Reasoning
Same table as the other Pack.c finding: a bilevel pack-dispatch table with legitimately named rawmode constants. The confusable warning is a false positive on distinct names.
-
iflikely benign Pillow storage setup branch for 1-bit images.Reasoning
The code checks mode == IMAGING_MODE_1 and sets bands and pixelsize for 1-bit images. That is standard Pillow storage initialization. The collision comes from the legitimate mode name.
-
static voidlikely benign Pillow byte-to-1-bit unpack function for numpy boolean images.Reasoning
unpack18 is a Pillow unpacker for boolean (|b1) numpy images, with a comment explaining the byte semantics. The skeleton collision with unpack8 is a naming coincidence, and the function body is ordinary pixel unpacking.
-
/* bilevel */ , , ,likely benign Pillow bilevel unpack-dispatch table.Reasoning
This is a Pillow unpack-dispatch table for bilevel modes, with distinct legitimately named unpack functions and rawmode constants. The rule's confusable match is spurious here.
-
/* bilevel */ , , ,likely benign Pillow bilevel unpack-dispatch table entry with confusable-looking rawmode names.Reasoning
Same bilevel unpack table as the other Unpack.c finding, with legitimately named constants whose skeletons collide. Benign.
-
, , ,likely benign Pillow unpack-dispatch table rows mapping 1-bit rawmodes to unpack functions.Reasoning
The snippet is a continuation of the Pillow unpack-dispatch table, mapping rawmodes such as IMAGING_RAWMODE_1_8 to unpack18. The confusable collision is a naming artifact, and the code is ordinary image-decoding dispatch.
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.
&&