Repository navigation
v3.13.0
Detection-engine hardening: ReDoS validation backstop, scan-window mechanism, all-category ingestion bypasses, new deserialization category, and breaking auth-verifier requirement (v3.13.0)
Special thanks to @hsnyus-09 and @iam-niranjan for your GHSA reports and the support throughout. Thank you for making the Guard Core ecosystem better!
Highlights
- Breaking:
require_auth/api_key_authnow require a verifier. Supply one per route (verifier=) or globally (SecurityConfig.auth_verifier), or 401 fail-closed (GHSA-x96c-fcg2-x2f9, CWE-287). - Breaking: 15 dynamic-rule snapshot fields validate on assignment.
auto_ban_threshold,blocked_countries,block_cloud_providers,blocked_user_agents, etc. now raiseValueErroron out-of-range or wrong-type instead of silently landing in the running config. - ReDoS backstop ships.
validate_pattern_safetyruns in a killable subprocess and flags adjacent broad unbounded quantifiers, ambiguous optional tails, unreachable terminator scans, and ambiguous literal boundaries; 35 known-quadratic built-ins are rejected pending pattern rewrites. The shared executor timeout is GIL-bound and does not bound a catastrophic match; a 512-byte User-Agent cap is the real bound (GHSA-r7hm-rjvg-xx7j, also closing CVE-2025-53539 and CVE-2025-54365). - New
scan_windowmechanism.bounded_search/bounded_finditerbound the regex search window (not the match length) forPREFIX[^x]*TERMINATORshapes, with no length cap and no N+1 bypass. - New
deserializationcategory (CWE-502). Java/pickle/PHP/.NET/Ruby serialized payloads in base64 wire form. - All-category ingestion bypasses closed. Non-UTF-8 body scan (CWE-693, every released version), preprocessor truncation gaps,
_BASE64_REfloor lowered 20 to 12, parameter names now scanned, structured-JSON operator keys, and asurrogateescapedecode boundary across five sites. - Detection widenings. Nine categories extended past literal spellings; seven widened to new contexts (header, url_path, query_param); new
nosql[$op],proto_pollution,template{{}}/#{},sqlitautology, andcmd_injectionbare$(...)/Log4Shell JNDI patterns. - Detection attribution behind a reverse proxy.
detect_penetration_attemptandlog_activitynow attribute threat events and log lines to the resolved real client IP, not the proxy socket peer. - Telemetry hygiene.
OtelHandlerandLogfireHandlerno longer clobber or destroy host providers;ban_iprefuses loopback and trusted-proxy targets and warns before banning a private IP that may be the proxy.
Breaking
require_authandapi_key_authrequire a verifier. Supply one per route viaverifier=or globally viaSecurityConfig.auth_verifier. Without a resolvable verifier, requests are rejected with 401 (fail-closed). Previously anyBearer/Basicprefix or any API-key header value was accepted without validation (GHSA-x96c-fcg2-x2f9, CWE-287). The old header-presence/scheme-prefix behavior is no longer the default; userequire_authorization_header(scheme=...)for a presence-only gate, documented as NOT authentication.- Post-construction assignment to 15 dynamic-rule snapshot fields now revalidates.
blocked_countries,whitelist_countries,rate_limit,rate_limit_window,endpoint_rate_limits,block_cloud_providers,blocked_user_agents,enable_penetration_detection,enable_ip_banning,enable_rate_limiting,emergency_mode,emergency_whitelist,auto_ban_threshold,auto_ban_duration,enable_rate_limit_auto_banraiseValueErroron a wrong-type or out-of-range value where a baresetattrpreviously accepted it silently.DynamicRuleManager._apply_rules's rollback restores every already-mutated field on a later validation failure, so a push stays atomic. SecurityConfig.auto_ban_thresholdandauto_ban_durationnow enforcege=1. Construction with0or a negative value now raises; pass1or above.block_cloud_providersaccepts six providers and rejects unknown names.DigitalOcean,Linode, andVultrjoinAWS/GCP/Azure. An unrecognized provider name (the part before an optional:!regionsuffix) now raisesValueErrorat construction and reassignment instead of being silently dropped. The argless@block_clouds()decorator now blocks all six providers; pass an explicit list to keep the previous three-provider scope.block_cloud_providers=NonestaysNone. Construction, assignment,model_copy, and dynamic-rule rollback/restore no longer silently driftNonetofrozenset(); every real consumer already gates on truthiness.
Added
is_ip_allowedandcheck_ip_accessare now exported at the top level asguard_core.is_ip_allowedandguard_core.check_ip_access, for websocket and framework-agnostic callers that have only a raw IP. Async and sync mirrors updated identically.check_rate_limit_by_ip(ip, config, redis_handler=None, endpoint_path="")(guard_core.check_rate_limit_by_ip): a request-free rate-limit primitive for websocket consumers. ReturnsTrue/Falseand records a hit per call. With the defaultendpoint_path=""the Redis key collapses to the HTTP pipeline's global bucket for that IP; pass a non-emptyendpoint_pathfor an isolated budget. Feeds the auto-ban engine whenenable_rate_limit_auto_banandenable_ip_banningare both set. Async and sync mirrors updated identically.SecurityConfig.enable_rate_limit_auto_ban(bool, defaultFalse): opt-in wiring that feeds rate-limit violations into the same auto-ban engine penetration detection uses;"rate_limit"is now a validthreat_ban_configkey. The suspicious-count structure is in-memory, per-process, and 10k-IP FIFO-capped, so multi-replica deployments do not share auto-ban counts. Async and sync mirrors updated identically.DynamicRules.auto_ban_threshold,auto_ban_duration,enable_rate_limit_auto_ban: Guard Agent dynamic-rule pushes can now tune auto-ban at runtime. Applied with the same setattr-plus-log convention as the existingenable_ip_banningtoggle; all three restore on rollback.DynamicRules.expires_atis honored. A dynamic rule push with a non-nullexpires_atauto-reverts its config mutations once that time passes. Naive (tzinfo-less)expires_atis treated as UTC. A rule whoseexpires_atis already past on receipt now never activates, instead of driving a revert-then-reapply loop every tick.SecurityConfig.auth_verifier: global default verifier callable forrequire_authandapi_key_auth.require_authorization_header(scheme=...): presence/scheme-prefix-only decorator, documented as NOT authentication.- Verifier contract:
verifier(request, credential) -> Principal | None. Sync or async in async (ASGI) deployments; sync-only in WSGI. An async verifier in WSGI, or any verifier that raises, is rejected with 401 fail-closed. The authenticated principal is stored onrequest.state.auth_principal. - Dedicated
Detection GateCI workflow (.github/workflows/detection-gate.yml) runs on every PR and master push, fails on sync-tree drift, and runs both detection benchmarks as a named job whose failure message names the regressed category. PatternCompiler.validate_pattern_safetyhardened. New structural rules flag adjacent broad unbounded quantifiers, ambiguous optional tails in quantified groups, unreachable terminator scans, and ambiguous literal boundaries. The runtime probe runs in a killable subprocess (subprocess.run(..., timeout=2.0), never a thread the caller waits on).validate_pattern_safetyaccepts an optionalmax_content_lengthand probes at the caller's real cap; everySecurityConfig-aware call site passes its own cap. Numeric backreferences (\1-\9) are now resolved in the reach probe; unresolvable backreferences and unreachable regions fail closed. Sync mirror updated in lockstep._MAX_USER_AGENT_MATCH_LENGTH = 512(guard_core/utils.py): the User-Agent header is truncated to 512 characters before any pattern runs against it, the request-body path'sdetection_max_content_lengthcap's missing counterpart. Chosen from ASP.NET's documented precedent. Sync mirror updated in lockstep.guard_core.detection_engine.scan_window(bounded_search,bounded_finditer, mirrored underguard_core.sync.detection_engine.scan_window): a drop-in replacement forcompiled.search(text)that bounds the regex scan window to where a match could possibly terminate, not the match length. No length cap, no N+1 bypass. Callers supplycompiled,prefix, andterminatorregexes built once per built-in pattern. Quote-aware (WHATWG HTML 13.2.5.34). Proven linear in a killable subprocess. Mechanism only; built-in patterns are wired in the Fixed section below.- New
deserializationdetection category (CWE-502) catches Java (rO0AB), Python pickle (gASV/gAWVplus GLOBAL-opcode text markers), PHP (O:/C:/E:), .NETBinaryFormatter(AAEAAAD) plus<ObjectDataProvider, and RubyMarshal(BAh[Jv7bV]) serialized payloads in their base64 wire form. Raw bytes are structurally unreachable (the body decode rejects non-UTF-8), so only the base64 wire form is matched. - Known-mechanism disclosure: UTF-16/UTF-32 wide-encoded payloads are detected, but as an accident of null-byte removal, not a designed capability, and now pinned (
tests/test_detection_engine/test_wide_encoding_detection.py). EBCDIC codepages (cp037,cp500, etc.) miss outright and are left unfixed as scoping data. - Committed adversarial ReDoS corpus (
tests/test_sus_patterns/test_redos_backstop_corpus.py): one maximally-adversarial payload per confirmed-quadratic built-in pattern family, run through the realsus_patterns_handler.detect()production entry point. Sync mirror updated in lockstep.
Changed
- CI enforces
--cov-fail-under=100and-W error. A coverage drop or a new warning now fails the build instead of accumulating.make lintrunsruff format --check .instead of rewriting in place; usemake fixto apply formatting. - Built-in detection patterns no longer compile with
re.MULTILINE. The global flag was the root cause behind five categories of false positives 3.12.0 fixed anchor by anchor; only three SSRF anchor usages remain, all with adjacent\salternatives that already consume newlines. User-supplied patterns keepre.IGNORECASE | re.MULTILINEunchanged. Sync mirror updated in lockstep. cmd_injectionflags structure, not a ~60-name hardcoded command list.${...}flags on POSIX bare-parameter-name grammar failure,$(...)keeps its ambiguous-context gate, quote-splice flags 3+ consecutive single-char fragments, glob-wildcard requires a preceding shell operator, brace-expansion requires start-or-operator anchoring and excludes:/quote from item grammar.${whoami}in bare prose is intentionally undetected (parameter expansion, not execution). Per-category recall baselines lowered as a ruled reduction, not a moved goalpost. Sync mirror updated in lockstep.- Structural rules become pre-filters; a timed cost arbiter decides.
validate_pattern_safety's default path builds every adversarial probe a battery of strategies can produce, times each at 4/8/16/32k chars usingtime.process_time()in a killable subprocess (minimum of 5 samples, median drives the verdict), and rejects only if the growth-extrapolated cost at the caller's real cap exceeds 50ms. A structural hit supplies the rejection reason when the arbiter also rejects and forces fail-closed rejection when no probe can be built; a structural hit measured under budget and linear no longer rejects on its own. The known-quadratic built-in constant grows from 22 to 35 entries, driven by measurement, not hand-picking. Sync mirror updated in lockstep.
Fixed
- LDAP forward-window and backtick context-window length cliffs. Both used a fixed 40-character window; a corroborating token 40+ chars away fell outside and silently stopped detecting. Replaced with scans bounded by the construct's own natural delimiters (balanced parens, quotes, newlines) and the next candidate start. No magic number, no cliff to relocate (CVE-2025-54365). Sync mirror updated in lockstep.
- Four
{0,N}-capped patterns converted to scan-window finders._LDAP_NULL_BYTE_ATTR_RE/_LDAP_NULL_BYTE_DECODED_ATTR_RE(value{0,255}cap was a live bypass),_QUOTE_SPLICE_CANDIDATE_RE,_GLOB_WILDCARD_ATOM_REroute through_WINDOWED_PATTERN_FINDERSinsuspatterns_handler.py; the{0,N}cap is a length cliff by construction (CVE-2025-54365) and an unbounded quantifier is quadratic (CVE-2025-53539), so neither is acceptable alone. Three template cap patterns ({{...}},${...}SSTI) stay capped pending a corrected sharedbounded_finditerthat an independent fuzz found silently drops matches. Sync mirror updated in lockstep. - Eleven built-in
PREFIX[^x]*TERMINATORpatterns route throughbounded_finditer. Script, style-expression, object, embed, applet, dir-traversal..;, file-inclusion URL, XML entity/DOCTYPESYSTEM, CDATA, DOCTYPE-external-entity, and the SSTI#{...}shape. CPU timing linear at the 262144-byte cap. Outcome parity differential-fuzzed per pattern (20,000 trials each, zero mismatches). Sync mirror updated in lockstep. - 26
recon/sensitive_file/cms_probingpath-probe patterns carried a released quadratic-backtracking DoS since the723e0882"Initial release" commit (0.1.0 and every tag since). The prefix group's own character class fully contains the mandatory literal that follows it. Fixed with a segment guard (_path_only_pattern, a negative-lookahead-disambiguation idiom). 25 of 26 now measure safe through the arbiter at the real 262144 cap. Sync mirror updated in lockstep. - Regex-match timeouts on the shared scan pool now report as a threat. A
time.process_time()-bounded regex that never finished is unknown, not absent;_check_regex_patternsnow builds apattern_timeoutthreat entry whentimeout_occurredis true and no real match was found. Sync mirror updated in lockstep. - Double validation on every dynamic-rule apply and rollback removed.
_apply_user_agent_rulesandDynamicRuleManager._restore_confignow useSecurityConfig._set_prevalidated, which skips only the_FIELD_REVALIDATORSre-check; the general assignment path is unweakened. The_skip_revalidationflag moved off the instance to acontextvars.ContextVarafter a reproduced thread race and amodel_copydouble-bypass. A pinned test fails if_set_prevalidatedis ever madeasyncor grows anawaitbetweensetandreset. Sync mirror updated in lockstep. ContentPreprocessor.truncate_safelyand the preprocessor now treatdetection_max_body_inspect_bytesas the single memory bound. A hardcoded 262144-byte scan window, aMAX_SHORT_BASE64_SCAN_BYTES = 2_000_000pre-slice, and aMAX_GUNZIP_OUTPUT_BYTES = 8192decompression cap all silently ignored a raiseddetection_max_body_inspect_bytes; the scan cap is now wired from the caller at both singleton and per-request sites, the pre-slice is deleted, and the gunzip output cap threads through from the knob.decode_common_encodings's 16-iteration budget now raises a syntheticcustomweight-1.0 threat when content is still changing on the final iteration.max_decode_iterationsraised from 7 to 16. Sync mirror updated in lockstep._BASE64_REfloor lowered from{20,}to{12,}. A payload whose encoded form falls under 20 characters was never a decode candidate;1' OR '1'='1(16-char blob) now detects. Measured 0 new false positives across a 2034-case benign base64-ish corpus at every threshold. Sync mirror updated in lockstep.- Four encoded-path-traversal evasion classes closed in
ContentPreprocessor. Newline/MIME line-wrap inside a base64 blob, gzip-then-base64, overlong-UTF-8 percent-byte runs (%c0%af,%e0%80%80%af,%f0%80%80%80%af), and%uXXXXIIS-style percent-u escapes are now decoded. A Unicode-lookalike renormalization pass folds decoded separator lookalikes to literal/or\.path_traversalnow compares the decoded view against the raw view and flags when decoding revealed a..[/\\]the attacker tried to hide. A newdir_traversalpattern catches..;/semicolon path-parameter bypass. Sync mirror updated in lockstep. SemanticAnalyzerwas quadratic on plain text. Fourattack_structurespatterns (tag_like,function_call,path_traversal,url_pattern) had unbounded greedy quantifiers whose class did not exclude their own start characters. Bounded to finite maximums;tag_likeis unbounded again but scanned only up to its last>via_tag_scan_window, the general technique for this defect class.extract_tokensno longer spins up tenThreadPoolExecutorinstances per call. Sync mirror updated in lockstep.ban_iprefuses loopback and trusted-proxy targets, and warns before banning a private IP that may be the proxy. A reverse-proxy deployment withtrusted_proxiesunset previously banned127.0.0.1and locked out all traffic. Refusal is a logged warning, never an exception; no opt-out. A private non-loopback IP (10/8, 172.16/12, 192.168/16, 169.254/16, IPv6 ULAfc00::/7) not listed intrusted_proxiesis still banned but logs a loud distinct warning that the IP may be a reverse proxy and the ban could block all users, so a misconfigured proxy egress is surfaced without refusing a possibly-legitimate internal ban; loopback is refused outright because it is never a real client. A Redis-down ban above the 1-hour local-cache cap now clamps to 1 hour instead of raising (previously:ValueErrorwithfail_secure=Truereturned HTTP 500 for every request;fail_secure=Falsesilently applied no protection). Sync mirror updated in lockstep.detect_penetration_attemptandlog_activityattribute to the real client IP behind trusted proxies, not the proxy socket peer. Both resolved the client IP fromrequest.client_host(the connecting socket peer, e.g.127.0.0.1) regardless ofconfig.trusted_proxiesandX-Forwarded-For, so behind a reverse proxy every threat log line and detection event was attributed to the proxy. Both now useextract_client_ip(request, config)(the same resolver the security pipeline already keys enforcement on), honoringtrusted_proxiesandX-Forwarded-Forand falling back to the connecting IP when no config or no forward is present. Enforcement (IP banning, rate limiting, suspicious-activity counts) was already keyed off the resolvedrequest.state.client_ipand is unchanged; only detection logging and threat-event attribution were wrong (issue #73). Sync mirror updated in lockstep.OtelHandlerandLogfireHandlerno longer clobber or destroy providers they do not own.OtelHandler.start()claims ownership only if it won the set-once race;stop()shuts down only a provider it recorded owning.LogfireHandler.start()checkslogfire.DEFAULT_LOGFIRE_INSTANCE.config._initializedbefore callingconfigure();stop()callslogfire.shutdown()only when this instance configured. Both are idempotent in any order. ALogfireHandler.start()that failedconfigure()no longer gets permanently stuck refusing to retry. Sync mirror updated in lockstep.scripts/unasync.py --checkno longer reports a missing sync mirror as "up to date" or deletes a mirror it just generated. Check mode generates into a temporary.unasync_check_tmp_directory and compares against the untouched real tree; a missing mirror printsMISSING:and exits non-zero, an orphan printsORPHAN:. Pinned with a test. Sync mirror updated in lockstep.BehaviorTrackerRedis sink no longer interpolatesendpoint_id,client_ip, orrule.patterninto aKEYSglob. All three now pass throughhashlib.sha256per segment, closing a glob-injection sink and a field-boundary collision. Counting is nowRedisManager.record_sliding_window_hit(one pipelinedZADD/ZREMRANGEBYSCORE/ZCARD/EXPIRE), no keyspace-wideKEYSscan. The sorted-set member isuuid.uuid4().hex, not the timestamp, so identical-timestamp hits each count separately (a 3000-request burst previously collapsed to 166 entries). Upgrading resets every identity's in-window counter to zero; old keys self-expire within one window. Sync mirror updated in lockstep.- Four
file_uploadfilename=sites carried a{0,255}cap, a live shipping bypass. A filename with a 256+ char prefix evaded detection. Caps removed; a new_file_upload_scan_windowtruncates each scan to the last quote character, linear per position with no length cliff.asmx,cer,phpsjoin the dangerous-extension list. The double-extension benign-terminal whitelist drops archive extensions (zip/gz/tar/rar/7z) that false-positived on backup and release-artifact filenames. Sync mirror updated in lockstep. - Three
xsspatterns (event-handler,href/src/data/action,style=expression) were genuinely quadratic. Fixed structurally, not by capping: a single non-quantified atom between the two adjacent broad quantifiers removes the ambiguous split. The event-handler pattern ison\w+scoped to a real tag/attribute shape (replacing an 11-name hardcoded enum), gated by a shared_HTML_TAG_OPEN_RE = r"<[A-Za-z/]"so a<used as a less-than operator no longer opens a false tag, with a 200-name event-handler allowlist derived from PortSwigger and OWASP. HTML5 whitespace around=is now tolerated (\s{0,20}) inxssandfile_upload. Sync mirror updated in lockstep. - A non-UTF-8 request body skipped the ENTIRE body scan in every released version (CWE-693). Appending or prepending a single invalid byte evaded every body-delivered pattern. The decode is now lossy (
errors="replace"); the honeypot trap-field decoder matches. Sync mirror updated in lockstep. - The request/response ingestion boundary now decodes invalid UTF-8 consistently across five sites using
errors="surrogateescape". Two were live bypasses (top-level raw-body decode,parse_qslin_scan_form_body,_multipart_text_parts); the other three (honeypot form/JSON, response body) are consistency fixes. A single_sanitize_for_reportinghelper round-trips scanned content throughsurrogateescapethenbackslashreplaceat the six reporting choke points, so a lone surrogate reaching aFileHandlerno longer silently drops the audit-log entry. This is a lockstep-upgrade requirement across the ecosystem. Async and sync mirrors updated identically. - Nine detection categories matched only the literal spelling of an attack technique.
proto_pollution(Object.prototype assignment,Object.setPrototypeOf/Reflect.setPrototypeOf),xml(PUBLIC external DTD),xss(java\tscript:control-char scheme),nosql(boolean$ne/$equnder a field key, not numeric range),file_inclusion(JSON value undertemplate/include/tpl/module/layout),ssrf(baremetadata/instance-datahost aliases),cmd_injection(Nodechild_process, PHPassert, Pythonos.exec*),code_injection(__import__('os').system), andeval(equivalents (Function,window['eval'],.constructor.constructor,setTimeout/setIntervalstring arg). Each adds a structural discriminator rather than another alias. Sync mirror updated in lockstep. - Seven detection categories widened to new request contexts.
xml+query_param,xss+url_path,cmd_injection+header(resolving an internal contradiction with the existing Log4Shell row),ssrf+url_pathandheader,template+url_path,deserialization+header.sqli+url_pathmeasured a real false-positive cost and is excluded. Three already-accepted benign-corpus tradeoffs became visible on the newly-exposed axis and are pinned. Sync mirror updated in lockstep. - New
nosql[$op]bracket-operator pattern,proto_pollutionarbitrary-key pattern,template{{}}/#{}shape-gated pattern,sqlitautology pattern, andcmd_injectionbare$(...)/${...}+ dedicated Log4Shell JNDI pattern.cmd_injectiongains 10 tool names (nmap,socat,msfconsole,msfvenom,certutil,bitsadmin,powershell,pwsh,mkfifo,aria2c) and absolute-path/env-prefixed shell invocation.xssslash-separated handlers (<svg/onload=) andssrfuserinfo (http://x@localhost/) detected.sqligainsCREATE, stackedSELECT...FROM/REPLACE INTO, andEXEC xp_/sp_system-proc patterns. Explicit-scheme RFI (?page=http://attacker/shell.php) is a dedicatedfile_inclusionpattern. Sync mirror updated in lockstep. - Request parameter NAMES now scanned for injection patterns.
_scan_query_params,_scan_headers,_scan_json_value,_scan_form_body,_scan_multipart_body, and the embedded-JSON-key path feed the name to the same pipeline as the value.?username[$ne]=admin,?__proto__[isAdmin]=true, a JSON body key"1;DROP TABLE x", or a multipart field named__proto__[x]are detected. An excluded header's name gets only the Log4Shell JNDI shield, preserving the GHSA-motivated excluded-header design. Structured JSON body operator keys ({"username":{"$ne":null}}) are detected at any depth. Numeric range operators ($gt/$gte/$lt/$ltewith a numeric literal) are not flagged as NoSQL injection: they are indistinguishable from legitimate range queries. Auth-bypass shapes ($nenull or boolean,$gt "",$regex,$where,$exists,$in) are flagged. Sync mirror updated in lockstep. _LDAP_WILDCARD_EQUALS_RErepurposed into a whitespace-tolerant breakout matcher. The crontab false-positive class and its entire exclusion mechanism are deleted; requiring parens structurally retires the name list. Extensible-match attribute syntax (attr:dn:matchingRule:=value), no-wildcard breakout (admin)(cn=x)), comparator breakout (~=/>=/<=), RFC 4515 backslash-hex escapes (\29\28), and a backward depth-scan length cliff ("x"*n + "*)(uid=*"stopped detecting atn=40) are all closed. The_ldap_wildcard_chain_is_injectionvalidator is split into three functions to stay under the xenon ceiling. Sync mirror updated in lockstep._LDAP_ATTR_EXTENSIBLE_MATCH_REhad an unbounded, uncancellable event-loop hang. The:dn/[\w.-]+alternation branches overlap completely, giving2^nequivalent parses; a 77-byte body hung the event loop for 7.76s. The redundantdnbranch is removed; a killable-subprocess regression test pinsdetect()returns within 2 seconds on"*)(a" + ":dn"*30 + "X". Sync mirror updated in lockstep.sqliWHERE-clause corroboration reverted; tautology pattern added._WHERE_CLAUSE_REno longer corroborates on a placeholder-shaped value; a new_SQLI_TAUTOLOGY_RE(\b(?:OR|AND)\s*(\d+|'[^']*'|"[^"]*")\s*=\s*\1\b) detects1 OR 1=1--and placeholder-prefixed tautologies at 1.0 category weight with no WHERE/SELECT dependency.SusPatternsManager._normalize_context(None)no longer raises. Sync mirror updated in lockstep.- Pickle
GLOBAL-opcode anchor relaxed and validator hardened. Any single legal opcode prepended beforeGLOBALpreviously defeated detection; a bounded, non-executing structural validator (_pickle_global_prefix_is_opcode_stream) replays the up-to-32-byte prefix window against apickle._Unpicklersubclass whosefind_class/get_extension/persistent_loadunconditionally raise.FRAMEis handled directly in the dispatch loop (the predicted short-read cause was wrong; the real defect was anAttributeError). The validator'sread/readline/readintonow raise on short reads instead of silently accepting truncated parses. Identifier quantifiers bounded to 100 chars/segment, 20 segments to close a quadratic ReDoS. Sync mirror updated in lockstep. - Negative JSON-structure result no longer suppresses the raw pattern scan.
_check_value_enhanced's embedded-JSON pre-check returned unconditionally on any non-Noneresult, so{"username":{"$ne":null}}nested one level down was invisible onquery_param/header. The early return now happens only whendetectedis true; a negative JSON result falls through to the raw scan. Sync mirror updated in lockstep. block_cloud_providers's:!regioncarve-out has never worked in any release that shipped it (3.2.0 through 3.12.0). Every refresh path looked the range fetcher up by the literal selector string, theKeyErrorwas swallowed, and the provider's IP ranges stayed empty forever. All four lookup sites now normalize selectors to bare provider names before lookup. Sync mirror updated in lockstep.integration-testisolation andMakefilecache-cleanup fixes. Four entrypoints hardcoded a sharedREDIS_PREFIXthat shadowed the PID-scoped default and let one suite's teardown wipe another's keys;Makefileandcompose.ymlnow passREDIS_PREFIXthrough only when set, and CI jobs drop the hardcoded value.make integration-testnow runs the async and sync OTel integration tests as separateuv run pytestinvocations so the process-global OTel providers do not collide. The 20 Makefile recipes that pipedfind .intoxargs rm -rfnow share oneCLEAN_CACHESvariable that hands each matched path torm -rfas its own argument regardless of embedded whitespace. Sync mirror updated in lockstep.RateLimitManager.reset()now clearsredis_handler. A previously-attached Redis handle no longer survivesreset()into a later test or production re-init. Sync mirror updated in lockstep.- Embedded-probe-in-prose known limitation disclosed, not shipped. An attack probe path embedded inside a full prose sentence (
Note: the scanner hit /wp-admin/install.php) is not detected; the whole-string anchor that stops benign documentation prose from false-positiving is exactly what makes a real probe invisible inside a sentence. Three corroboration strategies were measured against a 32-malicious/43-benign corpus; none cleared both recall and false-positive gates, so this stays a documented gap rather than a shipped mitigation. - Test-hygiene: a "not a working attack" pin no longer calls real
pickle.loadson attacker-shaped bytes. It now loads through a_BlockingUnpicklerwhosefind_classraises before resolution, same evidential value with no path to real code execution. Sync mirror updated in lockstep.
What's Changed
- chore(deps): bump github/codeql-action from 4.37.6 to 4.37.7 by @dependabot[bot] in #72
- ci(3.13.0): detection regression gate, coverage floor, warnings as errors by @rennf93 in #68
Full Changelog: 3.12.0...3.13.0