Skip to content

Commit f0a5ca1

Browse files
Denis GorbachevDenis Gorbachev
authored andcommitted
Add Meteor security patch
1 parent 5189765 commit f0a5ca1

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

server/meteor-security-patch.js

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
(function () {
2+
// Remove this code after updating to Meteor 1.0.1.
3+
var c = typeof Mongo === "undefined" ?
4+
Meteor.Collection : Mongo.Collection;
5+
var proto = c.prototype;
6+
var orig = proto._validatedUpdate;
7+
proto._validatedUpdate = function (userId, selector, mutator) {
8+
check(mutator, Object);
9+
if (_.isEmpty(mutator)) {
10+
throw new Meteor.Error(403, "Access denied.");
11+
}
12+
return orig.apply(this, arguments);
13+
};
14+
})();

0 commit comments

Comments
 (0)