Skip to content

PageSecurity.EnhanceClass is not thread safe #79

@joozek78

Description

@joozek78

PageSecurity.EnhanceClass is responsible for altering TypedJson schema of a view-model to include permission checking. Problems can now occur, because:

  1. Two threads access a view-model for the first time and they both enhance it at the same time, mangling their modifications
  2. Two threads access a view-model for the first time and one enhances it, while the other is using it
  3. There can be more problems

There should be locking in this method, but since it's on a path of every request a naive lock statement could hurt performance significantly.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions