Security fix to ReactionBleed in WeKan. It is XSS in feature "Reaction to comment".

Thanks to Alexander Starikov at Jet Infosystems (https://jetinfosystems.com/).
This commit is contained in:
Lauri Ojansivu 2023-04-18 01:30:54 +03:00
parent ce35799506
commit 47ac33d6c2

View file

@ -1,5 +1,14 @@
const commentReactionSchema = new SimpleSchema({
reactionCodepoint: { type: String, optional: false },
reactionCodepoint: {
type: String,
optional: false,
max: 9, // max length of reaction code
custom() {
if (!this.value.match(/^&#\d{4,6};$/)) { // regex for only valid reactions
return "incorrectReactionCode";
}
},
},
userIds: { type: [String], defaultValue: [] }
});