feat: attribute access as taint source for dataflow analysis (GAP-006) - #620
Merged
Merged
Conversation
Enable pure attribute access (x = request.url, name = file.filename) to be recognized as taint sources in dataflow analysis. Previously only function call results could be taint sources, causing ~40 detection rules to miss real CVEs where web frameworks expose user input as properties. Go engine: - Add AttributeAccess field to core.Statement, populated by extractFullAttributeChain() for RHS attribute nodes - VDG matches AttributeAccess against source/sanitizer/sink patterns - New AttributeMatcherIR and AttributeMatcherExecutor in DSL layer - Wire attribute_matcher and type_constrained_attribute into resolveMatchers() for use inside flows() Python SDK: - Add attribute() matcher function (parallel to calls()) - Add QueryType.attr() for type-constrained attribute matching - Update AnyMatcher union and exports Verified against 3 real CVE patterns: - GHSA-527m-2xhr-j27g (SSRF via request.url) - GHSA-ph9w-r52h-28p7 (path traversal via file.filename) - GHSA-vwmf-pq79-vjvx (RCE via request.data to eval) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
SafeDep Report SummaryNo dependency changes detected. Nothing to scan. This report is generated by SafeDep Github App |
Code Pathfinder Security ScanNo security issues detected.
Powered by Code Pathfinder |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #620 +/- ##
==========================================
+ Coverage 83.77% 83.84% +0.06%
==========================================
Files 155 156 +1
Lines 21298 21397 +99
==========================================
+ Hits 17843 17940 +97
- Misses 2801 2803 +2
Partials 654 654 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
- Remove unnecessary string() conversions in extractFullAttributeChain - Format query_type.py with black - Add 17 Python SDK tests for attribute(), QueryType.attr(), IR validation - Coverage: 97.51% (above 95% threshold) Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Cover attribute_matcher JSON unmarshal error branch - Cover attribute_matcher validation error branch - Cover type_constrained_attribute resolveMatchers path with detections - Cover type_constrained_attribute invalid JSON branch - Cover validateAttributeMatcherIR empty patterns + empty string - Cover extractFullAttributeChain nil node edge case - All patch lines now have count >= 1 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- sast-engine: 2.0.0 → 2.0.1 (patch: new attribute_matcher IR + executor) - python-sdk: 1.3.6 → 1.4.0 (minor: new attribute() and QueryType.attr() API) - Add CHANGELOG entry for python-sdk 1.4.0 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
shivasurya
force-pushed
the
shiva/gap-analysis-reports
branch
from
March 28, 2026 02:51
5fd23eb to
9f470ce
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Summary
AttributeAccessfield tocore.Statementto capture full dotted attribute chains on RHS of assignments (e.g.,request.url,file.filename,self.config.SECRET)attribute_matcherIR type andAttributeMatcherExecutorin DSL layer, wired intoresolveMatchers()for use insideflows()as source/sink/sanitizerAttributeAccessagainst taint source/sanitizer/sink patterns alongside existingCallTargetmatchingattribute()matcher function andQueryType.attr()for type-constrained attribute matchingCVE Verification
Verified end-to-end with Python SDK rules against 3 real CVE patterns:
request.url→requests.get()uploaded.filename→os.path.join()request.data→eval()Test plan
extractFullAttributeChain(simple, deep, negative cases)AttributeMatcherExecutortests (exact, suffix, multi-pattern, nil safety)gradle lintGo,buildGo,testGoall pass🤖 Generated with Claude Code