Skip to content

Conversation

@geoffw0
Copy link
Contributor

@geoffw0 geoffw0 commented May 15, 2023

Add tests for and fix some FPs caused by the sensitive data library. These patterns have been observed in real world projects at various times.

In addition to removing likely FPs, the regexp changes do introduce a few new possible results (e.g. matching mob_num, home_no, fax_num), but based on a large MRVA run I don't expect this to have a big impact.

I should probably run DCA on this PR to confirm it removes the three FP results that show up there.

@geoffw0 geoffw0 added no-change-note-required This PR does not need a change note Swift labels May 15, 2023
@geoffw0 geoffw0 requested a review from a team as a code owner May 15, 2023 15:45
this.asExpr() instanceof EncryptedExpr or
this.asExpr().getType().getUnderlyingType() instanceof BoolType
}
}
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@MathiasVP do you happen to know whether a potentially large set of barriers (here: all expressions of Bool type) is likely to be a performance problem or will only be evaluated in the restricted context of nodes on a potential flow path? (if you're not sure, I will spend a bit of time investigating this)

Copy link
Contributor

@MathiasVP MathiasVP May 15, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A large barrier predicate isn't generally an issue, no 🙂. The barrier will be evaluated prior to any real dataflow computation takes place so it won't be restricted to be nodes along path candidates, but I doubt that this will be an issue.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We've done similar things in C++ in the past (i.e., block flow through all integral-typed expressions), and performance for this has always been fine. So I'm not concerned about this at all.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, thanks!

Copy link
Contributor

@MathiasVP MathiasVP left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM once we have a DCA run!

@geoffw0
Copy link
Contributor Author

geoffw0 commented May 16, 2023

DCA shows two less alerts for swift/cleartext-storage-database on signalapp__Signal-iOS. This is a good change, they are known false positives targeted by one of the changes in this PR. Notably there were originally three false positives though, so I'd better investigate whether the third one still occurs or disappeared before this PR...

@geoffw0
Copy link
Contributor Author

geoffw0 commented May 16, 2023

Yep, looks like we went from 2 -> 0 results. Merging!

@geoffw0
Copy link
Contributor Author

geoffw0 commented May 16, 2023

... by which I mean re-running a failed check ...

@MathiasVP MathiasVP merged commit f5be8cf into github:main May 16, 2023
@geoffw0
Copy link
Contributor Author

geoffw0 commented May 16, 2023

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

no-change-note-required This PR does not need a change note Swift

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants