The Services 3.0 release exposes a number of methods which include an optional pagesize parameter. If a site is configured with certain permissions for anonymous user (e.g. "access content"), it is possible for an unauthenticated user to DOS a site with a large number of nodes by sending requests to the node index method with a large pagesize argument. The response to this request would be the entire contents of the node table in any format supported by Services.
The attached patches against 7.x-3.x (thanks, marcingy) and 6.x-3.x fix this by adding a "perform unlimited index queries" permission which restricts unlimited index queries to users with the appropriate permission, and add a set of variables which set the maximum page size for unauthenticated users.
| Comment | File | Size | Author |
|---|---|---|---|
| #12 | 0001-testing.patch | 11.71 KB | kylebrowning |
| #11 | 0001-testing.patch | 23.09 KB | kylebrowning |
| #8 | pagesize-permission-6-tests.patch | 10.97 KB | marcingy |
| #7 | pagesize-permission-6.tests_.patch | 10.97 KB | marcingy |
| #5 | pagesize-permission-7-tests.patch | 8.66 KB | marcingy |
Comments
Comment #1
marcingy commentedWill try and look at this over the weekend and add tests as suggested by Yuri.
Comment #2
marcingy commentedPatch with tests to ensure that only users with appropriate permission can retrieve more nodes than the default.
Comment #4
marcingy commentedSo with the failing test why are we checking the number of services permissions - totally and utterly pointless....achives nothing what so ever. Adding to this patch to get rid of said test.
Comment #5
marcingy commentedMore code can killed
Comment #6
ygerasimov commentedI think #5 is good to be committed.
Comment #7
marcingy commentedD6 version, will commit if the bot likes it
Comment #8
marcingy commentedComment #9
marcingy commentedBot doesn't seem to want to play this needs manual review.
Comment #10
kylebrowning commentedLooks good.
Comment #11
kylebrowning commentedlets see if drupal likes this patch.
Comment #12
kylebrowning commentedfucking drupal bot.
Comment #13
ygerasimov commentedLooks fine to me, but I was not able to apply the patch. Kyle could you please reroll?
Comment #14
kylebrowning commentedYeah the patch doesn't apply after you commit a coder change to the whole codebase :P
Comment #15
marcingy commentedCommitted thanks.
Comment #16
kylebrowning commented