Skip to content

C#: Fix cs/serialization-check-bypass#2658

Merged
hvitved merged 2 commits intogithub:masterfrom
calumgrant:cs/serialization-check-bypass-type
Feb 12, 2020
Merged

C#: Fix cs/serialization-check-bypass#2658
hvitved merged 2 commits intogithub:masterfrom
calumgrant:cs/serialization-check-bypass-type

Conversation

@calumgrant
Copy link
Contributor

Remove false-positives from this query, such as this one where the field is not serialized.

@calumgrant calumgrant added the C# label Jan 21, 2020
@calumgrant calumgrant requested a review from hvitved January 21, 2020 11:20
@calumgrant calumgrant requested a review from a team as a code owner January 21, 2020 11:20
@calumgrant calumgrant force-pushed the cs/serialization-check-bypass-type branch from 6d79c26 to 4b90c56 Compare January 29, 2020 15:46
@calumgrant calumgrant force-pushed the cs/serialization-check-bypass-type branch from 4b90c56 to 7caae01 Compare January 29, 2020 15:47
not callable.calls*(checkedWrite(f, _, _).getEnclosingCallable())
not callable.calls*(checkedWrite(f, _, _).getEnclosingCallable()) and
// Exclude object creations because they were not deserialized
not exists(ObjectCreation src | DataFlow::localExprFlow(src, result))
Copy link
Contributor

Choose a reason for hiding this comment

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

I think this should be generalized to

not exists(Epxr src |
  DataFlow::localExprFlow(src, result)
|
  src instanceof ObjectCreation
  or
  src.hasValue()
)

  - Flow from expressions with a value is excluded.
@hvitved hvitved merged commit 78380f5 into github:master Feb 12, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants