Skip to content

Commit

Permalink
Merge pull request #173 from izar/issue-172
Browse files Browse the repository at this point in the history
HTML escaping missed the 'target' field when cleaning Findings
  • Loading branch information
izar authored Sep 23, 2021
2 parents 81911a9 + da975ea commit 445f3a9
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pytm/pytm.py
Original file line number Diff line number Diff line change
Expand Up @@ -687,7 +687,7 @@ def __repr__(self):
)

def __str__(self):
return f"{self.target}: {self.description}\n{self.details}\n{self.severity}"
return f"'{self.target}': {self.description}\n{self.details}\n{self.severity}"


class TM:
Expand Down Expand Up @@ -775,6 +775,7 @@ def resolve(self):

finding_count += 1
f = Finding(e, id=str(finding_count), threat=t)
logger.debug(f"new finding: {f}")
findings.append(f)
elements[e].append(f)
self.findings = findings
Expand Down Expand Up @@ -1855,6 +1856,9 @@ def encode_threat_data(obj):
"condition",
]

if type(obj) is Finding or (len(obj) != 0 and type(obj[0]) is Finding):
attrs.append("target")

for e in obj:
t = copy.deepcopy(e)

Expand Down

0 comments on commit 445f3a9

Please sign in to comment.