Skip to content

Commit ebb91dc

Browse files
committed
PS: Add a few more models after fixing MaD for Element content.
1 parent 6de4765 commit ebb91dc

File tree

2 files changed

+8
-6
lines changed

2 files changed

+8
-6
lines changed

powershell/ql/lib/semmle/code/powershell/dataflow/internal/FlowSummaryImpl.qll

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -57,20 +57,20 @@ module Input implements InputSig<Location, DataFlowImplSpecific::PowershellDataF
5757
}
5858

5959
string encodeContent(ContentSet cs, string arg) {
60-
exists(Content c | cs = TSingletonContentSet(c) |
60+
exists(Content c | cs.isSingleton(c) |
6161
c = TFieldContent(arg) and result = "Field"
6262
or
6363
exists(ConstantValue cv | c = TKnownKeyContent(cv) or c = TKnownPositionalContent(cv) |
6464
result = "Element" and
6565
arg = cv.serialize() + "!"
6666
)
67-
or
68-
(c = TUnknownPositionalContent() or c = TUnknownKeyContent()) and
69-
result = "Element" and
70-
arg = "?"
7167
)
7268
or
73-
cs = TAnyElementContentSet() and result = "Element" and arg = "any"
69+
cs.isAnyPositional() and result = "Element" and arg = "?"
70+
or
71+
cs.isUnknownKeyContent() and result = "Element" and arg = "#"
72+
or
73+
cs.isAnyElement() and result = "Element" and arg = "any"
7474
or
7575
exists(Content::KnownElementContent kec |
7676
cs = TKnownOrUnknownKeyContentSet(kec) or cs = TKnownOrUnknownPositionalContentSet(kec)

powershell/ql/lib/semmle/code/powershell/frameworks/MicrosoftPowershellUtility/model.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,6 @@ extensions:
7272
- ["microsoft.powershell.utility!", "Method[format-table]", "Argument[-inputobject,pipeline]", "ReturnValue", "taint"]
7373
- ["microsoft.powershell.utility!", "Method[format-wide]", "Argument[-inputobject,pipeline]", "ReturnValue", "taint"]
7474
- ["microsoft.powershell.utility!", "Method[get-unique]", "Argument[-inputobject,pipeline]", "ReturnValue", "taint"]
75+
- ["microsoft.powershell.utility!", "Method[get-unique]", "Argument[-inputobject,pipeline].Element[?]", "ReturnValue.Element[?]", "value"]
7576
- ["microsoft.powershell.utility!", "Method[join-string]", "Argument[-inputobject,pipeline]", "ReturnValue", "taint"]
77+
- ["microsoft.powershell.utility!", "Method[join-string]", "Argument[-inputobject,pipeline].Element[?]", "ReturnValue", "taint"]

0 commit comments

Comments
 (0)