I prepared a fix to this bug in: Use userfield serializer in json dump by b-studios · Pull Request #3662 · discourse/discourse · GitHub
Since this might be a security concern and I am limited in my knowledge of the guardian, I think it is important that some knowledgable people review the change carefully.
EDIT The fix now has been merged.