Seed sinks for priority niche languages#95
Conversation
andrew
left a comment
There was a problem hiding this comment.
Thanks for this, the coverage is solid and the regression test is a good addition.
One fix needed in knowledge/fsharp/language.toml: the Assembly.Load sink pairs threat = "code_injection" with cwe = "CWE-470", which crosses two registry entries. CWE-470 is the unsafe_reflection CWE; code_injection maps to CWE-94. Please change it to threat = "unsafe_reflection" so it lines up with Activator.CreateInstance just below it.
Two optional ones while you're in there, take or leave:
unsafePerformIO in knowledge/haskell/language.toml isn't really a code-injection sink. It breaks referential transparency but doesn't evaluate caller-controlled code. Almost every Haskell project with FFI will trip on this, so it'll mostly be noise in brief sinks. I'd drop it.
YAML.parse in knowledge/crystal/language.toml returns YAML::Any rather than instantiating arbitrary types, so the deserialization risk is much weaker than the Ruby equivalent. Fine to keep if you want the coverage, but the signal is thin.
thanks, fixed.
Validation: |
Closes #36.
Summary
Adds
brief sinkscoverage for the priority niche languages called out in #36:The added sinks cover common command execution, dynamic evaluation, deserialization, path traversal, SSRF, XXE and denial-of-service surfaces where applicable.
Also adds a KB regression test to ensure these priority language definitions continue to include sink data.
Validation
go test ./...