- The filters a template's render reaches change, and with them the advisories reported
as
exploitable-vulnerabilitythrough a filter, which may appear or disappear: a render now follows a cycle of includes as far as Django may render it (#284), and places a template's blocks where its chain of extends places them (#285). - Plugin API, additive:
coretrace_python.source.LineIndexgives the line and column of each offset of a text, lines counted aslines_ofcounts them (#288).
- A cycle of includes no longer stops the collection of the filters a render reaches
(#284). A template reached again on the way contributes what it reaches, its names
mapped through each include, as Django renders it when the project's conditions let
the cycle turn: a template including itself with other bindings, a recursive tree, or
a parent including the child that extends it. A filter reached this way may be
reported as
exploitable-vulnerabilitywhere it was not. Where no cycle is reached, the filters and their order do not change. - A template's render is put together over its extends chain as Django places its
blocks (#285). A filter in a block no template of the chain places, or in a block
whose only placeholder a child replaces, is no longer reached, and an advisory naming
it is no longer
exploitable-vulnerabilitythrough it. A block a child redefines with{{ block.super }}inside a block it replaces now renders the parent's definition and what it includes. Where the chain cannot be followed to a root, every block counts as placed, as before.
- Templates in a cycle of includes are no longer walked again on every path (#284): 20 levels of doubled includes closed into a cycle took 56 s, and 40 templates including one another more than a minute; both now take less than a second.
- The positions in a template are no longer counted from its start, for each filter, include, extends and load (#288): a template of 2 MB applying 160,000 filters took 50 s to analyse, and now takes 3 s.
docs/usage.mddocuments how a cycle of includes is followed (#284) and where the chain of extends places a template's blocks (#285).
- The cache format changes (19): caches built by an earlier version miss once.
- A module in a directory without
__init__.pyinside a package is named after that package, as Python names it (#264):pkg/sub/app.pyispkg.sub.app. Its relative imports now resolve, and a file that was asyntax-error(relative import beyond top-level package) is analysed, flask'ssansiofor one. The project symbols of its functions change with its name (python.pkg.sub.app.view), which a model declared on the former symbol must follow; baseline keys do not change, since they hold no module name. A script beside it still imports it by its short name, which answers no import from another directory: at the project root,import osis the library even beside apkg/sub/os.py, which a top-level module of a directory took before. Files that share only that short name are no longer noted asambiguous-module, nor is an import that only such names from other directories match. - SARIF: each rule carries a title (
shortDescription) and a description (fullDescription) instead of repeating its id (#270), and each result carries its confidence as theconfidenceproperty (#271). A flow reaching its sink inside a project function points at that sink as a related location, which the result's message links to (#271). - Django templates are read as a browser reads them (#263, #272, #278): a template that
leaves a tag, a
<script>or<style>block or an end tag open, or includes one that ends inside such a construct, is no longer established as escaping, soxssmay be reported where it was not. - Django templates are also read as each page is put together (#273): a variable a
child's
{% block %}prints inside its parent's<script>, an{% include %}that ends the attribute value it stands in, or one of a name several files have outside HTML data, is reported asxsswhere it was not, as is the variableblocknamed anywhere but in a bare{{ block.super }}. So is a template that includes Django'sdjango/forms/widgets/attrs.htmlinside a tag, which prints attribute names, and a template including itself inside a tag or a script. A page beyond 8 MiB once put together, or a template with more than 64 pages, or 16 MiB in all, through names several files have, is not established and is listed inCoverage.unread_templates. - Plugin API, additive:
Plugin.rulesmaps the rules a plugin reports to theirRuleDescription, optional, so that third-party plugins describe their own rules;Finding.relatedlistsRelatedLocations (a span and a message).Report.rulescarries the descriptions to the reporters. - Plugin API:
coretrace_python.interprocedural.starting_summariesgives the summaries an import cycle's members start from, andcoretrace_python.engine.MAX_PROJECT_ITERATIONSis removed, since the project's summaries are iterated until they settle (#261). - A summary lists its external calls in source order (#261): a finding naming the first
call of a callee's summary may name another of that callee, at the same line, as 4 of
saleor's 228
orm-n-plus-onefindings do.
--checkends on projects whose summaries never settled (#261). Around a call cycle of three functions or more, a caller copied its callee's external calls in an order that rotated forever, so ansible, fastapi, sentry and home-assistant never ended: those calls are now kept in source order. Around an import cycle of three modules or more, the project's iteration shifted by one module each time and stopped at its bound, which could miss a sink reached through the cycle: its members now start from the summaries a module starts from, and the iteration goes on until the project's summaries settle.- A lambda or comprehension in the annotation of a parameter or a variable no longer
stops the analysis of a directory with a
KeyError(#262). An assignment expression in an annotation binds its name as Python 3.11 to 3.13 do: in a function, the name is a local whether the annotation is evaluated or not; at module level, it exists only once the annotation is evaluated.
- Start tags and their attributes are read as the HTML tokenizer reads them, in time
linear in the size of the template (#263): a few dozen characters under a
templatesdirectory, a PNG or<afollowed by 40 letters, stopped the analysis. A tag a template leaves open is read to its end and its attributes are checked; a quoted value left open stays quoted to the end of the template. - A
<script>or<style>block or an end tag a template leaves open runs to the end of the template, and a variable inside it is refused, even where the page ends there (#272). A template that ends inside such a construct or a tag is not established where it is included, since the markup after the include continues it, and a template extending another ends where that one ends. - A comment ends where a browser ends it (
-->,--!>, at once for<!-->and<!--->), and one left open hides the rest of the template (#272). A comment holding template tags may end at any of them, since an include there may close it and a condition around its<!--may leave it out, or run to its close when they render nothing: it is read on from its first tag, and that reading must be in HTML data right after each later tag and right after the close (#278). Such a comment left open does not end in HTML data.
- Collecting the filters a template's render reaches walks each template once for each set of blocks the templates extending it override (#279). It followed every path through nested includes: two includes of one template at each of 20 levels took 31 s. A template in a cycle of includes is still walked again wherever the cycle cuts its walk short.
docs/usage.mddocuments how templates are read and each page is put together, the modules of a directory without__init__.py, assignment expressions in annotations, and the rule descriptions and related locations of the SARIF report;docs/plugins.mddocumentsPlugin.rulesandFinding.related.
- The cache format changes (16) and the PyIR schema version is 2: caches built by an earlier version miss once. Every cache key also holds the engine version, so this release reanalyses every module of a cached project, which delivers the fixes below to it.
code-injectionreports new sinks (dynamic imports,runpy, the import path,getattrcalls), so findings may appear once; each keeps the rule idcode-injectionand is titled by what the input chooses (#240). Refutation proves more allowlists and fewer mutated collections (#239),unsafe-xmlmessages and confidences change (#242), and a sink in code that cannot run, or a call to a returned callable, is no longer reported (#258, #240). Baselines recorded before should be recorded again after review.- Findings carry new metadata, exported in JSON and as SARIF result properties:
context(test, besides a rule's ownexample) for test code (#244), andorigin: vendoredfor code underthird_party,third-party,vendororvendored(#243). Vendored code is still analysed and reported; the metadata changes no verdict. - A project located under a directory named
test,tests,testing,fixturesor__tests__no longer has every credential at low confidence:hardcoded-credentialandconfig-secretsjudge a file's path in the project (#253). - Plugin API, all additive:
SymbolCallDetector.describereturns aCallReport(message and confidence) per call (#242);PluginContext.path(source_id)gives a file's path from the root of the analysis, andrun_pluginsandanalyze_filetake that root (#253, #244);Sinkgainsselectsandrequires_called_result, andSink.applying(#240);- summaries gain
ExternalCall.invoked_atandNonlocalWrite.kept, flowsTaintFlow.invoked_at, andNonlocalResultitspreviousvalue (#240, #258); coretrace_python.findings.contextclassifies paths (is_test_code,code_context,code_origin,path_in_project).
- The module
importlib.import_module,__import__orrunpy.run_moduleimports and the filerunpy.run_pathruns are sinks, by position or keyword; the package of a relative name, the globals and the run name are data. TitledUntrusted module importandUntrusted script execution; a constant package prefix gives a hotspot (#240). - The directory
sys.path.insert,appendorextendadds is a hotspot,Untrusted import path, as code runs only when a later import resolves there;site.addsitediris a vulnerability,Untrusted site directory, its evidence stating that it runs the.pthfiles of a directory the attacker must control. Writes tosys.paththat are not calls are not covered (#240). getattr(obj, name)(...)with a name the input chooses is a hotspot,Untrusted attribute call, reported at each call of the result, withselected_lineandinvoked_line, in the function and through project functions. A result that is only read, returned or stored before it is called is not reported (#240).- These sinks are proven only by a check that limits the value to constants (membership in a constant allowlist, equality with a constant); a check of its shape (
isidentifier(),isalnum(),re.fullmatch) leaves a hotspot. Forgetattr, a check where it selects counts past a join, a check before the call counts in the same loop iteration only, and nothing is reported when the selection or the call cannot run (#240). - Calling the result of a call, or an item of it, calls what the call returned: its arguments are no longer read as the call's, so
eval('lambda x: x')(data)orimportlib.import_module('plugins')(data)reports nothing (#240).
- A membership test proves the value when every member is a constant that cannot change before the test: a tuple, list or set display, or a dict display by its keys, directly or through
.keys();frozenset,set,tupleorlistof one of these; a module-level tuple orfrozensetof constants bound once and never rebound. A list, set or dict of the function counts only while the function only reads it; a module-level one never does (#239). - A lookup in a dict display gives one of its values, of what was stored in it since, or the default, never a key: input that only selects the entry is no longer passed on (#239).
unsafe-xmlstates what each parser family risks: entity amplification with Expat older than 2.7.2 for the standard library, which reads no local file; external entities in lxml before 5.0, and initerparseandETCompatXMLParserbefore 6.1 (CVE-2026-41066);resolve_entities=Truewhatever the version,'internal'before 5.0. A parser givenresolve_entities=Falseis not reported; XML content the project wrote itself, passed to a function that parses its argument as the document, is reported at low confidence (#242).
- A project function's summary keeps nothing of the code constant propagation proves cannot run: no sink, returned, merged or stored value reaches its callers (#258).
- A
nonlocala nested function may leave unwritten (no write on some path, a write that cannot run, an exception before it) keeps the value the caller's variable held before the call, joined with what may be written (#258). - Warnings Python raises while parsing an analysed source (an invalid escape sequence) no longer reach the analyzer's standard error (#241).
-j N(--jobs N) analyses independent modules inNprocesses,0for one per core the process may run on; the report does not depend on it (#205). Each worker prepares the project once and reads the summaries a component imports from the cache or a directory of the run's own, instead of receiving them with every task: on healthchecks,-j 8takes 7.9–9.2 s against 15.3–15.5 s with-j 1(#245).
docs/usage.mddocuments the new sinks and their limits, constant allowlists, thecontextandoriginmetadata, unreachable code andnonlocalwrites, and re-measured performance;docs/plugins.mddocumentsdescribe,PluginContext.pathand the newSinkfields.
- Baselines change format twice in this release, and no baseline is ever converted or rewritten on its own. Without a key, baselines are recorded in schema 3, whose entries hold digests of the text a finding covers instead of that text (#226); with a key, in schema 4, keyed with HMAC-SHA-256 (#235). Schema 1 and 2 files are still read without a key, with exact matching only: an entry identifies a finding on a single line as before, a finding over several lines is reported new, and every run warns on standard error that the file may contain secrets in plain text. While a key is given, only a schema 4 baseline is read: an unkeyed one (schema 1, 2 or 3) stops the check with exit status 2. To migrate, review the findings, then record the baseline explicitly with
--record-baseline(schema 3, or schema 4 with a key); the old file's secrets remain in the history of a repository that committed it. - A keyed baseline needs its key: from the file
--baseline-key-filenames, which must lie outside the analysed directory and be another file than the baseline, or else fromCORETRACE_BASELINE_KEY; the file comes first. The key is at least 16 bytes, trailing line breaks are not part of it, and an empty variable is an error. Without the key, or with another one, the check stops with exit status 2 and records nothing; recording over a schema 4 baseline without its key is refused too. Rotating the key is an explicit--record-baselineunder the new key. Generate the key at random (python -c "import secrets; print(secrets.token_hex(32))") and keep it out of the repository: a key a person chooses can be guessed from the baseline (#225). - Findings may move or reappear once: dependency and configuration findings of a check given a relative root are now located relative to that root (
uv.lock, notproj/uv.lock) (#212); findings in JSON, TOML and lock files are located at their own line or by a JSON pointer (#222); a vulnerable package pinned in a lock file is located at its own[[package]]entry. Baselines recorded before should be recorded again after review. - A finding whose line cannot be established has a file location: in the JSON report its
line,column,end_lineandend_columnarenulland apointerfield names the value (RFC 6901); its SARIF location has noregion, the pointer under the location'sproperties; the text report showspath:without a line. Inline suppressions apply only to findings at a verified line (#222). command-injectionseverities change: an element of an argument list run without a shell is reported by what the input controls there,mediumby default,highwhen an option of the program runs it, refuted when a constant prefix keeps it from being an option or an option keeps it as data (#217). The rule id is unchanged; the message of an option injection is titledOption injection(#232). Existing suppressions and baselines of the rule keep matching by rule id; baselined findings whose severity changed are still baselined.- A file whose syntax is nested more than 200 levels deep (a long chain of
+or chained calls, which only generated code writes) is reported as asyntax-errorand not analysed, instead of aborting the whole scan (#234). - The cache format changes (14): caches built by an earlier version miss once.
- Plugin API:
Finding.spanis aLocation, aSourceSpanor aFileLocation(#222);Assessmentgains optionaltitleandmetadatafields (#232). Plugins that readfinding.span.start_lineshould check for aSourceSpanfirst.
--record-baselinerecords the current findings as the baseline even when the file exists; the file (the target of a symbolic link) is replaced atomically, keeping its permissions, only once the analysis succeeded and the report is rendered, so the previous baseline stays in place when the check fails (#235).--baseline-key-file FILEgives the key of a schema 4 baseline;CORETRACE_BASELINE_KEYgives it otherwise. The key never appears in a report, message or file; akey_checkvalue in the baseline tells the key apart without revealing it (#235).- An entry is recognised by a digest of the text of every line its finding covers: a secret written over several lines, whose first line does not hold it, is new once its body changes (#223, #226). A finding at a file location is recognised by digests of its value and of its pointer, whose keys may themselves be secrets (#222, #226).
- Line numbers follow one rule everywhere, as Python counts lines (
\n,\r\nor a lone\r, never U+2028 or a form feed), so a fingerprint or a suppression never refers to another line (#222).
- A string expression whose parts are all constant (
+of strings,sep.joinof a list or tuple of strings, an f-string whose parts are all constant) is judged as one value, reported once at the whole expression with the strongest finding of the value and its pieces;PASSWORD = "Zx81kQpL" + "w0RtY7vB" + …andTOKEN = "ghp_" + "…"are now reported. When the whole value is no secret, its pieces are judged on their own, as before (#231). - A
.env, YAML, INI or properties value that continues past its key's line (an open quote, a trailing backslash, deeper indentation) is located over every line it continues on (#226). - Password hashes are no longer reported as hardcoded credentials: modular crypt and PHC strings, bcrypt, Werkzeug's
scrypt:/pbkdf2:and Django's encodings; an identifier followed by text of another shape is still a plaintext password (#214). - The
urlpattern no longer reports placeholders (?token=...,<token>) nor an IP address orlocalhostand a port before@(proxy specifications); a password runs to the last@before the host. ASecretPatternmay name asecretgroup, which the placeholder check then judges (#215). - In
package-lock.jsonandnpm-shrinkwrap.json, the keys of dependency,requiresandbinmaps are package or command names, not credential names (#216).
- The command a process starter runs (
subprocess.run,call,check_call,check_output,Popen) is read element by element, with a documented option model for git, ssh, tar, rsync, find, rm, cmd, PowerShell, the shells and the interpreters, wrappers such as sudo, env, xargs and timeout read again with their program's model; the evidence says what the input controls (#217). - The finding's
injectionmetadata says what the input is when the rule establishes it:command(it runs or chooses what runs) oroption(an option, or the value of an option not established to run it), in the JSON report and as the onlypropertiesof the SARIF result; it is absent when the kind cannot be established (#232, #236). - The script after
pwsh -Fileis a file name, however it is spelled (#229).gtaris read as GNU tar,bsdtaras libarchive's (-Inames a file of patterns), and a baretar's-I,--to-commandand--checkpoint-actionarehighand kept for review (#230).
- A vulnerable package pinned in
uv.lockorpoetry.lockis located at its own entry, and the message states the evidence:werkzeug 3.1.5, pinned in uv.lock, is in <3.1.6 (required by flask)(#222). Requirements ofpyproject.tomlare located at their own element or key, or given a file location. --advisoriesand--policypaths, and the root itself, are resolved once, so their findings and notes are located relative to the root whatever the working directory (#212).
- Syntax nested deeper than the analysis follows is rejected before PyHIR is built, and Python 3.11's parser recursion is a parse error of the file, so the rest of the project is still analysed (#234).
docs/usage.mddocuments keyed baselines,--record-baseline,--baseline-key-file, file locations and theinjectionmetadata;docs/plugins.mddocumentsFileLocation,Assessment.titleandmetadata, and thesecretgroup of aSecretPattern. Repository governance files (contributing, conduct, authors, security) are added (#204).
- An
argumentcondition may carrypresent: true: the argument being passed at all, whatever its value, is the condition, as a\rinweb.Response(reason=…)needsreasongiven, constant or not. It names the argument by keyword or position as today and excludesvaluesanddefault. A call giving the argument — positionally, by keyword, or through a**literal with constant keys, folded into the keywords — meets it even when the value is unknown, so attacker input there makes the call exploitable; a call surely not giving it is ruled out (app:5 python.aiohttp.web.Response(reason absent)) and a project passing only such calls staysnot_affected; a call unpacking*argsor a**mappingwhose keys are not written leaves it pending review (#195). - A curated entry point may declare
suffixes, for receivers the engine cannot type:Item.objects.annotate(...)derives the project's ownpython.app.models.Item.objects.annotate, which the canonicalpython.django.db.models.QuerySet.annotateentry point never matches. A suffix matches any symbol of the project's own modules ending with a dot plus the suffix, on dot boundaries as aSuffixSinkmatches, never another package's symbol; a queryset chain is declared explicitly (objects.filter.annotate), and a suffix is at least two dot-separated names. The finding keeps the advisory's symbol asentry_pointand the derived one assymbol; conditions,attacker_argumentsand the ruled-out evidence of contradicted calls apply through a suffix as through the exact symbol. An exact advisory sink whose symbol a bundled suffix sink also matches (objects.extra) now composes its kinds with the suffix sink's instead of shadowing them (#197). - An advisory condition of kind
sequencesays the flaw spans two calls on one receiver: the first call leaves state on the object the entry point — the second call — reuses. It names themethodthe first call must be, by canonical name or.-suffix, and, optionally, the argument that call must carry ({"kind": "sequence", "method": "Session.get", "argument": "verify", "values": ["False"], ...}), sos = requests.Session(); s.get(url, verify=False); s.get(other)marks the secondgetreachable with the prior call as evidence (requests CVE-2024-35195). A receiver followed whole — bound once to the result of a call or awithand used only to call its methods — with no matching call on every path to the entry call rules it out (app.fetch:6 python.requests.Session.get(no prior Session.get on the receiver)), and a project with only such calls staysnot_affected. A receiver the engine cannot follow (a parameter, a module-level instance, one passed to another function or mutated through an attribute), a matching call only in a branch or textually later, an unpacking that leaves the first call's arguments undecided, or an entry call that itself carries the named argument — its own prior across the iterations of a loop — leaves the condition pending review (#194).
CallSite.prior_callsrecords, for a receiver the engine follows whole, the other external calls on the same receiver (PriorCall: symbol, location, arguments, and whether it surely executes before this one), in source order;CallGraph.prior_calls_atreads it by location, andcheck_conditionstakes it to decidesequenceconditions. The cache format changes.
- An advisory condition of kind
keyword_namesays the attacker must choose a keyword name of the call, as Django's ORM takes column aliases and lookups (annotate(**{alias: expr})); it carries its text and nothing else. The engine decides it from the keys of what the call expands with**, apart from the mapping's values: keys carrying attacker input meet it and the call is exploitable; constant keys, a dict literal with string keys,dict(total=...)or plain keywords, contradict it whatever the values carry, so the call is ruled out (app.views:12 python.app.models.Item.objects.annotate(keywords=total),(keywords absent)for a call passing no keyword) and a project passing only those staysnot_affected; keys the engine cannot establish, a**extraparameter, a mapping built elsewhere,dict(zip(...)), leave it pending review, so the call is reachable, and exploitable when the mapping's values carry input (#193).
- The keys of a mapping carry taint of their own, apart from its values: a dict literal
{alias: expr},dict([(alias, expr)]), a comprehension{k: expr for k in input}and a subscript assignmentmapping[alias] = exprtaint thekeyslocation of the mapping's abstract object, which{**mapping},dict(mapping)anddict(**mapping)copy; the value taint of a literal is what it was. A call expanding such a mapping with**passes its keys as the keyword names of the call, a way of passing only an advisory sink reads. Keys through a project wrapper are not followed;mapping.update(other),mapping.setdefault(k, v),for k in mappingandmapping.keys()carry no key taint; a mapping bound by aPhiis unknown (#193).
Arguments.keyword_unpackedsays a call expands a**mappingwhose keys it does not write; a**literal with constant keys that nothing else uses is recorded as its keywords, sogiven()decides safe arguments and argument conditions for it. The cache format changes.
- Two files with the same Python module name,
a/app.pyandz/app.pyoutside any package, no longer overwrite each other: both are discovered, analysed and covered whatever the order they are found in. The engine tells them apart by their path from the root as a module name,a.appandz.app, in the module graph, the summary index, the cache keys and what project plugins see; a unique name stays what it was. An import of such a name resolves to the file in the importer's own root only, and one no root resolves is not followed. Each colliding file carries anambiguous-modulenote and is covered asambiguous, since a model or a route namingpython.app.mainapplies to every definition of that symbol, and so does an importer whose import stayed unresolved; a VEX statement over such a project staysunder_investigation(#182).
- A
TEMPLATESassigned inside a function or a class no longer counts as Django settings: only a module-level assignment can activate therequestcontext processor, and only a mention of the module'sTEMPLATESelsewhere leaves that activation uncertain. A function-localTEMPLATES, called or not, used to enable the implicit request source, upgrading a template filter finding to exploitable (#184). - A template block that renders
{{ block.super }}keeps the parent block's content, so the filters the parent applies stay fed by the render context, with the parent template as the place of the call; a block without it still replaces the parent's whole block, and a chain of templates keeps exactly the parents each level renders. The parent's filters used to drop out of the exploitable flow as soon as a child defined the block (#185). - A project tag library registering a filter of a built-in's name replaces the built-in in every Django template loading it before applying the filter, as Django's parser does:
{% load custom %}{{ bio|striptags }}calls the project'sstriptagswhenapp/templatetags/custom.pyregisters one, so it is no longer a reachable or exploitable call todjango.template.defaultfilters.striptags; the project's function is ordinary code, analysed as any other. A load affects only the filters after it, a later load overrides an earlier one,{% load striptags from custom %}replaces only what it names, and Django's own libraries change nothing. The analyzer reads the registrations onregister, adjango.template.Libraryhowever it is imported, in decorator and call form, at module level or underif,tryor a function. Where it cannot tell what a library registers — no such library file, one it cannot read or parse, a name not written as a constant,registerpassed elsewhere or filled throughfilters=orregister.filters, or two apps giving the name and registering different filters — a filter of that name applied under the load is neither the built-in nor certainly replaced: no call is claimed, and the load counts among the templates the analyzer could not read (app/templates/app/profile.html:1 loads 'custom', not read), so an advisory naming the filter staysunder_investigationin the VEX document. The settings'OPTIONS["libraries"]andOPTIONS["builtins"]are not read (#183).
ModuleFunction.aliasesgives a project plugin the module-level names bound to a function by assigning one name to another, transitively and in source order, so an integration declaring a handler by the name a module binds (handlers.main) can report a name the engine resolves to no function; a method or a nested function has none. The cache format changes.- An
EntryPointnaming a project function or class applies through a module-level alias of it:main = actualmakespython.app.handlers.mainnameactual, so a deployment declaringhandlers.mainreaches the function doing the work. An alias is an assignment of one name to another at module level, followed transitively and in source order, in a conditional or atryas well; a name bound inside a function or class, or to a call, an import or anything but a name, is no alias, and the engine still infers nothing from a name. A model naming a method wins over one naming its class, whichever name it uses.
- A Django template file the analyzer cannot read, because of its permissions, no longer counts as escaping everything it renders: it read the file as empty text, and an empty template escapes. The flow through
render_to_stringstaysxss, and a template extending or including the unreadable one is not established to escape either, as for a template the analyzer cannot find. An unreadable file was already listed among the templates the project names but the run could not read.
- An
EntryPointmay name a project function or class by its own symbol,python.app.handlers.main, so an integration reading a deployment declaration, a SAM template or aserverless.yml, can make a bare Lambda handler an entry point; the engine itself infers nothing from a function's name.EntryPoint.inputslimits the parameters that are input to the given positions, afterselffor a method: the handler's event, not its context (#180).
BasePattern(pattern, label, parameters, kinds)makes the methods of a class whose base's canonical symbol matches a regular expression entry points, for bases generated per project such as a gRPC servicer's, whatever the module's prefix and however the base is imported. Each parameter afterselfis, by position, either input of the model's kinds or an object of a class the model names, which the sources on that class taint without the object being input: aSourceonServicerContext.invocation_metadatagives the client's metadata, andpeer()gives nothing. When the project holds the base, only the methods the base defines are entry points, so a servicer's utility methods are not; otherwise every method with the listed number of parameters is.asyncmethods and the messages of an iterated parameter are covered (#176).
- A filter of Django's own libraries that a project template applies is a call to the function behind it, at the template's line:
{{ bio|striptags }}callsdjango.template.defaultfilters.striptags, and so do filters in tag arguments and{% filter %}blocks. An advisory entry point naming that function is reachable there, whether or not a Python call names the template, since a class-based view renders itstemplate_nameinside Django. A template the analyzer cannot read may apply any filter: when the project names one by an expression, or by a name found under notemplatesdirectory, inrender,render_to_string,TemplateResponse,{% include %}or{% extends %}, an advisory whose entry points include a template filter staysunder_investigationin the VEX document, and the notes say where.render,TemplateResponseandSimpleTemplateResponseare now template renders likerender_to_string(#146). - Attacker input in a render context reaching a template filter makes an advisory entry point naming that filter exploitable at the render call. The analyzer links them only where it is certain of the value: a dict literal with constant keys that the render call alone uses, and a filter the rendered template applies to a context variable, directly or through
{% for %},{% with %}, constant{% include %}and{% extends %}, earlier filter arguments and{% filter %}blocks, in the blocks that render. A name a tag binds shadows the context, and{% include ... only %}passes none of it. The filter's value is its first argument, the filter's own argument its second. A project function rendering what it receives carries it the same way (#146). - The request the
requestcontext processor adds reaches a template's filters too, as{{ request.GET.q|striptags }}, only where the analyzer is certain of it: every Django template engine the settings assign toTEMPLATES, as literals no other code names, lists the processor; the render call passes the request (render,TemplateResponse,render_to_stringgivenrequest) with a certain context, absent or a dict literal; nothing shadowsrequest; and the template reads a text attribute of the request object, such asGET,POST,COOKIESorheaders. Otherwise the filter stays reachable (#146).
open-redirectjudges a flow on the destination a browser resolves from the target's constant text, with its own criteria rather than SSRF's. A reference on the current site keeps the browser there, so the flow is refuted. Such a reference is/followed by a character that is not a slash, a backslash, a space or a control character, as in"/profile/" + id; or?,#, or a relative path whose first segment holds no:. A fixed absolute host makes the flow a hotspot, since the input chooses the path, where that host may redirect again. Everything else stays a vulnerability, including"/" + next://evil.comis another host. The URL facts both rules read are one shared proof,coretrace_python.taint.urls, andssrfnow reads it too, with the same verdicts. The regression corpus is unchanged: its threeopen-redirectfindings redirect to values built without constant text (#168).
- An advisory entry point may declare a
hostcondition: the attacker must choose the host of the URL passed as the named argument. It is decided from the URL's constant text, the proofssrfandopen-redirectread. A fixed host with redirects disabled in the call leaves the call reachable, not exploitable. A fixed host with redirects followed keeps it exploitable, because a redirect may lead to a host the attacker controls, and the condition pending review says so. Input in the query does not choose the host. Anything else stays pending review, and so do the environment conditions. Ahostcondition must name its argument and carry nothing else (#170).
ssrfjudges a flow on how+and f-strings build its URL. A fixed host is a limited proof: when constant text fixesscheme://hostand ends the authority with/,?or#before any input, as in"https://api.example.com/users/" + id, the flow is a hotspot, because the input still chooses the path and a redirect may lead elsewhere. It is refuted only when the constant text fixes the path too, the input reaching the query or fragment only, and the call disables redirects (allow_redirects=False,follow_redirects=False). A module-level name counts as known text when the module binds it once to a string literal and never rebinds it. Everything else stays a vulnerability, including a base of unknown value such as an importedBASE_URL, which may leave the authority open. The advisory correlation keeps its own verdict. The regression corpus is unchanged: its sixssrffindings build their URL from values of unknown content (#165).
TaintDetector.judge(ctx, function, flow, verdict)lets a rule refine the refutation's verdict on a flow for its own findings, without changing the verdict other consumers of the flow read (#165).
- The text attributes and URL parameters of a request object carry no
NOSQL. Django, REST framework, aiohttp and tornado views read a request tainted as a whole, sorequest.GET["name"]and a URL parameter werenosql-injectionlike the body. NowGET,POST,COOKIES,META,headers,query_params, aiohttp'squeryandmatch_info, tornado'sargumentsand the other text attributes are text, and so are the URL parameters a view receives after the request. The body, the files, REST framework'sdataand aiohttp'sjson()keep the kinds of the request. The other kinds are unchanged, and so is the regression corpus. A helper function the request is passed to still reads it as a whole (#162).
- A
RequestObject(symbol, text=())model says that the inputs from an entry point, a route registrar, a typed parameter or a source are request objects, and which of their attributes are text (#162).
- A module-level name bound to an attribute, an item or a call of another module-level name resolves in functions, as the same value does in a function body.
cursor = conn.cursor()afterconn = sqlite3.connect(...),db = client.shopandrun = os.systemused to leave the calls made through them unknown, so a query built from request data and executed through a module-level cursor was not reported. Names resolve in statement order. The regression corpus is unchanged (#155). nosql-injectionreports attacker input that may hold a structure reaching a NoSQL sink, such as a MongoDB filter, where a JSON body giving{"$ne": null}matches any value. Only input that may hold a structure carriesNOSQL: JSON, the raw bodies ajson.loadsdecodes, files, WebSocket messages and standard input. Text cannot hold an operator. The text sources of Flask, bottle and tornado, the URL parameters of their routes, the command line, the environment andinput()no longer carryNOSQL. Neither does an entry-point parameter annotated with scalars (str,Optional[int],Annotated[str, Query()],list[str], …), which FastAPI validates. Two limits remain. Django and aiohttp request objects stay tainted as a whole. The keys of a dict are not followed, so a string concatenated into$whereis not reported. The engine ships no NoSQL sink: model plugins declare them (#158).
-
TEXT_KINDSholds every kind butNOSQL: what text input carries. A model plugin declares its text sources with it (#158). -
A
Members(symbol, dynamic=None, defined=(), typed=())model says what the attributes and items of a class's instances give, for libraries whose objects give others by names the project chooses. A pymongo client gives the database it is dotted or indexed with, a database gives a collection. The names used to end up in the symbol (MongoClient.shop.users.find), or an item vanished into its container's symbol (MongoClient.find), so no model could list them. With the model, every path to a collection denotes the collection class, the one a parameter annotatedCollectiondenotes:client.shop.users,client["shop"]["users"],client.get_database("shop").get_collection("users"), a module-leveldb = client.shop, an attribute inherited from the client class. A sink onCollection.findcovers them all. Symbol resolution now depends on these models, which the engine provides to every module and worker (#157).
code-injectionreports attacker input reaching the codeevalorexecruns, with the same verdicts as the other taint rules. The globals and locals passed with the code are data, not code.dangerous-evalstill reports every call toevalorexec, whatever it runs. The regression corpus gains three findings, each reviewed as a true positive: pygoat'smitre_lab_25_apiandcmd_lab2evaluate a POST field, and thevulnerable-flaskfixture evaluates a query parameter (#152).
-
A directory check names what its result was produced with, besides the engine and the sources. It lists each plugin it loaded, by manifest name and version, and each advisory file it read, by path, each with the SHA-256 digest of its content. The formats show them in these places:
- JSON:
tool.components; - SARIF:
tool.extensions; - CycloneDX SBOM:
metadata.tools.components, with their hashes; - OpenVEX: the document's
tooling, so its@idchanges with the advisory data.
Every finding about an advisory names the plugin (
name@version) or advisory file it comes from, in itsadvisory_sourcemetadata. The cache key and the reports identify a plugin by the same digest (#149). - JSON:
- An advisory entry point may name the
attacker_argumentsthrough which attacker input exploits it: by keyword, and by position when the argument may be passed positionally, a variadic one taking every later position. Attacker input in another argument leaves the call reachable instead of exploitable, so an advisory forsend_from_directorythat names itspathno longer countsdownload_name=, and one forrequests.getthat names itsurlno longer counts the body. An argument unpacked with*or**may fill any of them: like an argument condition it leaves undecided, it does not rule the call out, so a wrapper forwarding*args, **kwargsstill reaches the entry point. An entry point naming no argument counts every argument, as before. Each taint flow now records how its value is passed to the sink (#145).
- A
Validatorproves its argument safe only for the kinds it declares. A validator declared forREDIRECTused to refute a command injection through the same value; the flow is now a hotspot, and it is refuted only when the validator covers every kind reaching the sink (#143). - A sanitizer called inside a project function protects the flows through that function, for every caller. That covers a helper that escapes before answering, a view redirecting to
reverse(...), and a helper rendering a template the analyzer shows escaping. Function summaries keep, for each parameter, the taint kinds cleared on every path from it to an external call or to the return value. A path that skips the sanitizer, or a kind it does not clear, still reaches the sink. The cache format is bumped (#134).
Plugin.project_models(root)lets a plugin read models from the project under analysis, such as validators the project declares in a file. It is called once per directory check, in every process, and its models are part of the cache key. A model declared wrongly raisesModelError, which the command line now reports as an error (exit status 2) instead of a traceback (#140).- A
Validatormodel may name a function of the project by its project symbol (python.hc.accounts.views._allow_redirect), and the refutation recognises it in its own module too, where a call to it has no imported symbol. A project can thus declare its own validation helpers, and a flow they guard is refuted (#134).
- A dominating guard makes a flow a hotspot only when it examines what the sink receives.
if request.method == 'POST':beforerequest.POST['cmd']no longer lowers a vulnerability to a hotspot. A test of the value itself, of the same attribute, of a method called on it (form.is_valid()), or of any part of an object the flow passes whole still does. The regression snapshots record the verdict of each taint finding (#135). - The SSRF sinks of Requests and httpx read the destination only: the URL (the first argument, the second after the method for
requestandstream, orurl=) or the prepared requestsendtakes. Attacker data in the body, the JSON, the headers or the query parameters is no longer a server-side request forgery.Sinkgainskeywordsnext topositions, and function summaries keep the name of each keyword argument, so a project function forwardingurl=still reaches the sink; the cache format is bumped (#128). render_to_stringescapes what it renders where the analyzer can establish it: on a directory check, it reads the project's Django templates, and a template escapes when neither it nor what it extends or includes marks output safe, uses a tag, filter or library beyond Django's own, or prints a variable where HTML escaping does not protect it, and no settings turn autoescaping off. Data reaching a response through such a template is no longerxss; any other template keeps the flow reported.TemplateRenderdeclares such rendering calls, and the escaped templates are part of the cache key (#130).- Django's
csrf.get_tokenreturns a token of letters and digits whatever the request holds, andreverse/reverse_lazybuild a local path that attacker data in their arguments or query cannot turn into another host: the first is no longer an injection, the second no longer an open redirect.reversestill carries other kinds, since it leaves'unquoted (#132).
--vex PATHwrites an OpenVEX document with one statement per advisory affecting a requirement. A statement isaffectedwhen the project's code reaches the vulnerability, including findings the policy accepts or a comment suppresses. It isnot_affected(vulnerable_code_not_in_execute_path) only for an advisory with entry points that nothing reaches, in a complete analysis, and when the lock file shows no other package requiring the vulnerable one. Anything else isunder_investigation, with the reason (#97).
- An advisory entry point marked
readis an attribute whose getter runs the affected code, such asrequest.form: reading it is reachable, called or not — a subscript, an iteration or a method called on it reads it — with one finding per function, where it is first read (#111). - A lock file records which packages require which.
DependencyGraph.required_by(name)gives the other packages requiring a package; the project's own packages are not counted.ProjectAnalysis.acceptedkeeps the findings of advisories the policy accepts (#97).
yaml.load_all,yaml.full_load_allandyaml.unsafe_load_allare deserialization sinks like their single-document versions;yaml.load_allwith a safe loader is not, andyaml.safe_load_allstays safe (#123).
- A sink call can be made safe by one of its arguments: a
SafeArgumentmodel names the argument and the values that take kinds off the sink, only when the call gives one explicitly.yaml.loadwithSafeLoader,BaseLoaderor their C versions, under every spelling, is no longer an insecure deserialization; an absent loader, another loader, a variable or unpacked arguments still are (#121).
- The call graph records the symbols each function reads, called or not, where it first reads each:
CallGraph.reads(function)gives them asSymbolReadrecords, modules served from the cache keep them, and the cache format is bumped (#111).
- Argument conditions of advisory entry points are decided at each call, with a
positionfor positional arguments and adefaultfor absent ones: a call meeting them is reported withconditions_met, a call passing another known value does not reach the vulnerability and is listed in the requirement'sruled_out, and a call the analyzer cannot decide leaves them pending review (#110).
ProjectContext.functions(module)gives project plugins every function of a module as its call graph names it, with its span and the label of the entry point it is (httpfor a route,argvfor a command), decided by the taint engine's own rule; modules served from the cache keep them, and the cache format is bumped (#116).- Call sites and external calls record what each argument denotes — a symbol, a constant as Python writes it, or nothing known — in an
Argumentsrecord:CallSite.arguments(formerly the argument counts),ExternalCall.arguments, andTaintFlow.sink_argumentsfor the sink call of a flow, through callees in other modules too (#110).
- The module body and the bodies of top-level classes are analysed as the functions
<module>andCls.<body>: their calls are call sites, their values carry taint, and an advisory entry point called at import time or in a class body is reachable. Coverage counts them; the cache format is bumped so cached results gain their findings (#113).
- Advisories distinguish the
affected_symbolsa fix changed from the publicentry_pointsthrough which they are reached, each justified and carryingconditions(checkable argument values, orsemanticones kept as pending review);modulesnames what the package installs. Every dependency finding records its evidencelevel:declared,imported,reachableorexploitable(#109). - A call to an API affected by several advisories of the pinned release reports every one of them, not the first listed (#109).
- One advisory per identifier and package: a later contributor replaces an earlier one, so a curated feed refines the bundled sample, and the sample names the modules its packages install (#109).
- A version specifier may be a union of ranges separated by
||, as an advisory over several release series needs (>=4.2,<4.2.28 || >=5.2,<5.2.11); the OSV import produces one such advisory per package instead of one per range (#112).
- Every plugin module is registered in
sys.modulesbefore it runs, so a single-file plugin may define a dataclass underfrom __future__ import annotations(#105). ProjectPlugin.refine(ctx, findings)lets a project plugin reclassify the findings of a run: severity, confidence and added metadata only, withrefined_byand the original values recorded; anything else raisesRefinementError(#106).
- Two plugins may declare the same symbol: an identical model is registered once and sinks merge their kinds and positions; a real conflict names both plugins instead of failing the run on the first duplicate (#92).
- A plugin's entrypoint may be a package,
<module>/__init__.py, so a plugin can split its tables across files and import them relatively (#93). - The cache key covers every file of a plugin directory, not only
.pyand.toml, so rules or advisories shipped as data invalidate cached results when they change (#94).
- New taint kinds:
NOSQLinTaintKind.ALL;LOGandPIIoutside it, carried only by the values a model marks, so a NoSQL-injection, log-injection or personal-data detector no longer has to share a kind with another rule (#96).
- A
Sanitizerdeclared on a function of the analysed project takes precedence over the summary derived from its body, in the same file and across files, so a code base can declare its own validation layer (#95).
- Report paths are relative to the checked root; the JSON report carries the root and the SARIF log declares it as the
SRCROOTURI base, so code scanning attaches alerts to files (#75). # coretrace: ignoreand# coretrace: ignore[rule, rule]silence a finding on its line, in Python sources and requirements files; suppressed findings are counted, listed and marked in the reports (#76).--baseline PATHrecords the accepted findings on the first run and fails later runs on new findings only; findings are recognised by file, rule, function and line text, not line number (#77).--fail-on SEVERITYsets the exit status to 1 only from that severity up (#78).
- Assignment expressions,
yield from, starred assignment targets, class keyword arguments and any assignablewithtarget are supported; they used to reject whole files (#80, #86). - A
nonlocalwrite made by a nested function flows back to the enclosing function when it calls that function directly, the last documented approximation (#84). - An attribute a class does not define resolves through its base, so
self.get_argumentin a Tornado handler andself.requestin a Django class-based view denote the framework's; static methods called on the class resolve to the method and pass no receiver (#89). - Route registrations are found inside functions such as
setup_routes(app: Application), andawait f()denotes whatf()denotes (#88).
- New security models: aiohttp, Tornado, Bottle, and the aiopg, asyncpg, psycopg2 and PyMySQL drivers (#88, #89).
- New rules:
insecure-tls,unsafe-xml,unsafe-archive-extraction,insecure-temp-fileandweak-random(#90).
- Hex digests, subresource-integrity hashes and character-set constants are no longer high-entropy secrets; credentials in test code and template files are reported at low confidence;
token_type-like names are not credentials (#81, #82, #87). - Redirect sinks read their target argument only, so
redirect("url-name", arg)is not an open redirect (#83). - Environment variables and process output are operator-controlled: they carry no command or path kinds, except a downloaded script piped into a shell (#87).
- A container literal passed to a sink is serialised, never rendered, so it carries no HTML (#89).
- A module's functions are collected once; 25 to 30 percent faster on large projects, measured on healthchecks, rich and wagtail and recorded in the usage guide (#79).
- The regression corpus grows to 19 repositories, including healthchecks, dvpwa, pygoat, the FastAPI full-stack template, httpie and luigi (#79, #85).
- The Apache License 2.0 text ships with the repository and the wheel (#74).
First release on PyPI: the analyzer with its 26 bundled plugins, the regression suite on 13 public repositories and the usage and plugin guides.