Repository navigation
feat: security detectors and plugin models - #24
Merged
Merged
Conversation
4 tasks done
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
Last Phase 5 item of
docs/architecture.md: detectors on the shared taint engine (§15 Analysis Providers and Detectors, §25 Plugin Types, §35–§36).test: define detector and model plugin behavior), implementation follows.Plugin.models: any plugin may contributeSource,SinkandSanitizermodels;ModelPluginis the provider-only kind of §15. The engine loads every plugin first, collects their models into one registry, then provides the table, so framework models and detectors compose without knowing each other.TaintDetectorturns the flows of one taint kind into findings with source label, sink symbol and location.SymbolCallDetectorreports calls whose callee resolves to a canonical symbol by reading the SSA form, so local aliases such asshow = print; show(x)are followed.plugins/:models/python_stdlib(stdin, argv and environment sources; command, code, path and SSRF sinks;shlex.quote,html.escapeandos.path.basenamesanitizers),security/{sql_injection,command_injection,path_traversal,ssrf,xss},syntax/weak_crypto.dangerous_evalnow sits on the shared base.requires = ["taint.flows"]andprovides = ["vulnerability.<rule>"]; the loader checks them against the classes.End to end:
--checkonos.system(input())reports a command injection; a test-written model plugin providing HTTP sources and SQL/HTML sinks turns the same detectors into SQL injection and XSS findings, rendered to SARIF.Known limitation, unchanged by this PR: a function using syntax outside the lowering subset (nested definitions, keyword arguments, ...) aborts the whole check with a diagnostic instead of being skipped.
Closes #23