Closed (fixed)
Project:
Drupal core
Component:
node.module
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
30 Jul 2005 at 19:58 UTC
Updated:
16 Sep 2005 at 01:22 UTC
Jump to comment: Most recent file
To reproduce:
- Take a page which is denied to anonymous users by node_privacy_byrole
- Go to it as an anonymous user
- Receive 404 error
Note: this bug did not exist in 4.5.x
| Comment | File | Size | Author |
|---|---|---|---|
| #6 | 27864-node.module-4.6.2_0.patch | 682 bytes | willmoy |
| #2 | 27864-node.module-4.6.2.patch | 682 bytes | willmoy |
| #1 | 27864-user.module-4.6.2.patch | 686 bytes | willmoy |
Comments
Comment #1
willmoy commentedTested patch against 4.6.2 branch attached.
Comment #2
willmoy commentedNew patch. Correctly handles both 403s and 404s. Adds an extra query to verify which is happening.
Comment #3
dries commentedThat code is insecure and may lead to SQL injection attacks.
Comment #4
willmoy commentedThe patch doesn't include enough context to show that the query is subject to a check of is_numeric(arg(1)). I don't think this is vulnerable to SQL injection, but I'd be grateful if someone else would check and I apologise if I'm missing something.
The patched code in context:
The cvs version of this patch http://drupal.org/node/27873 has the same context.
Comment #5
killes@www.drop.org commentedI think the problem is this:
WHERE nid=%s', arg(1)
It should be
WHERE nid = '%s'", arg(1)
if arg(1) were indeed a string, but since it isn't it should be
WHERE nid = %d', arg(1)
Comment #6
willmoy commentedThanks very much killes, that was dumb of me.
New patch attached.
Comment #7
Steven commentedCommitted.
Comment #8
(not verified) commentedComment #9
(not verified) commentedComment #10
(not verified) commentedComment #11
(not verified) commented