mirror of
https://github.com/github/codeql.git
synced 2026-05-03 12:45:27 +02:00
Merge pull request #11337 from hmac/actionmailbox
Ruby: Model ActionMailbox
This commit is contained in:
@@ -0,0 +1,12 @@
|
||||
messageInstances
|
||||
| action_mailbox.rb:3:5:3:8 | call to mail |
|
||||
| action_mailbox.rb:4:5:4:8 | call to mail |
|
||||
| action_mailbox.rb:6:5:6:10 | call to mail |
|
||||
| action_mailbox.rb:10:5:10:8 | call to mail |
|
||||
| action_mailbox.rb:16:9:16:12 | call to mail |
|
||||
remoteFlowSources
|
||||
| action_mailbox.rb:3:5:3:13 | call to body |
|
||||
| action_mailbox.rb:4:5:4:11 | call to to |
|
||||
| action_mailbox.rb:6:5:6:13 | call to to |
|
||||
| action_mailbox.rb:10:5:10:18 | call to text_part |
|
||||
| action_mailbox.rb:16:9:16:23 | call to raw_source |
|
||||
@@ -0,0 +1,7 @@
|
||||
private import codeql.ruby.frameworks.ActionMailbox
|
||||
private import codeql.ruby.DataFlow
|
||||
private import codeql.ruby.dataflow.RemoteFlowSources
|
||||
|
||||
query predicate messageInstances(ActionMailbox::Mail c) { any() }
|
||||
|
||||
query predicate remoteFlowSources(RemoteFlowSource r) { any() }
|
||||
@@ -0,0 +1,24 @@
|
||||
class A < ActionMailbox::Base
|
||||
def process
|
||||
mail.body
|
||||
mail.to
|
||||
m = inbound_email
|
||||
m.mail.to
|
||||
end
|
||||
|
||||
def other_method
|
||||
mail.text_part
|
||||
end
|
||||
end
|
||||
|
||||
class B < A
|
||||
def process
|
||||
mail.raw_source
|
||||
end
|
||||
end
|
||||
|
||||
class C # not a mailbox class
|
||||
def process
|
||||
mail.subject
|
||||
end
|
||||
end
|
||||
Reference in New Issue
Block a user