Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Reporter:
Created:
14 Jul 2012 at 11:21 UTC
Updated:
18 Aug 2012 at 18:01 UTC
Hello,
Please find my application information below:
Project Description
It's a module that provides you with a block where you can have it on whatever region you like and it gives you a conferencing functionality. It's very configurable as there are permissions for pretty much every functionality and also the admin settings. I tried to find similar modules but I don't believe there is any.
Project Page
http://drupal.org/sandbox/caiovlp/1687816
Drupal version
Drupal 7 only.
Thank you,
Caio
Comments
Comment #1
klausiWelcome!
We are currently quite busy with all the project applications and I can only review projects with a review bonus. Please help me reviewing and I'll take a look at your project right away :-)
Comment #2
caiovlp commentedReviews of other projects:
http://drupal.org/node/1236914#comment-6234688
http://drupal.org/node/1102520#comment-6234522
http://drupal.org/node/1189362#comment-6234582
Thanks,
Caio
Comment #3
klausiRepository seems empty? Git clone fails:
fatal: http://git.drupal.org/sandbox/caiovlp/1509002.git/info/refs not foundRepository viewer looks empty too: http://drupalcode.org/sandbox/caiovlp/1509002.git
Comment #4
drupwash commentedCoding Standard looks good.
You should implement hook hook_help() http://api.drupal.org/api/drupal/modules!help!help.api.php/function/hook... because developer would like to read installation process in site as you have configuration on SID, TOKEN.
So it will help developer to read installation process from site rather than readme.txt
else Nice Work
Need Review http://drupal.org/node/1682682
Comment #5
klausi@drupawash: how did you manage to examine the code? Did you clone it with git?
Let's leave it at "needs work" until the issue with the repository is resolved.
Comment #6
caiovlp commented@klausi: Please use the git clone command I provided. The sandbox's ownership was changed but the git URL still has the old owner's login. I'm assigning it back to "needs reviews" so you can review it, let me know if anything.
@drupawash: Thanks a lot for the feedback, will work on it.
Comment #7
caiovlp commentedSorry, forgot to change the status.
Comment #8
drupwash commentedI have taken a fresh clone and installed in my locally and after manual review Instead of forcing, I'm just suggesting to implement hook_help().
Comment #9
misc commentedThis si just confusing. Which is the correct address to clone the repo?
Comment #10
caiovlp commentedThe correct clone address is in the original post and it works. I don't get why you changed the status to postponed if it was already on RTBC.
Again, the correct address is:
git clone --recursive --branch 7.x-1.x caiovlp@git.drupal.org:sandbox/ciandt/1509002.git twilio_conferencing
Comment #11
misc commentedThis is not RTBC at all, there are a lot of stuff you still have to do get this as RTBC.
First of all, give us the address to the sandbox that anyone could use - the address you pasted is not availble for us other users, and
git clone http://git.drupal.org/sandbox/caiovlp/1509002.git twilio_conferencingthat is on the sandbox page does not work ("fatal: http://git.drupal.org/sandbox/caiovlp/1509002.git/info/refs not found: did you run git update-server-info on the server?")Washim, how did you clone it?
Comment #12
klausiThe clone command only works for your user account. And before this can get a full project we need a working sandbox with working repository instructions and a working repository viewer. So I suggest to simply create a new sandbox, push the code there and copy the project page.
Comment #13
caiovlp commentedI've created a new sandbox and renamed the other one to "Twilio Conferencing (old)". I didn't delete the original sandbox because I wanted to keep the history (there were patches applied).
http://drupal.org/sandbox/caiovlp/1687816
Comment #14
klausiIf you want to keep the history just change the git remote of the old checkout, then you can git push all the commits into the new sandbox.
Comment #15
misc commentedAssigning myself for manual review.
Comment #16
misc commentedManual review:
'inc/Twilio/Capability.phpintwilio_conferencing_block_content. Andinc/Twilio.phpintwilio_conferencing_mute_participant. There are no inc folder in the repo.Also there are hard coded stuff like:
$client = new Services_Twilio($account_sid, $auth_token, '2010-04-01');, why?Comment #17
misc commentedRemoving review bonus.
Comment #18
caiovlp commented@MiSc Thanks for your feedback. Can you please answer my questions below before I re-apply?
Master Branch - Don't think this is an issue, but I'll make this change.
Including fiel that are not in the module folder - The step #2 in the README.txt specifies to download Twilio's PHP library and place its contents under the include folder. How would you make it clearer?
Use module prefix for variable names - I'll work on that.
Project page - Can you be a little more specific? I think the project page is pretty good and there is even a live demo.
Images, made by you or GPL? - They were GPL but were modified.
Javascript, written by you? - Yes.
Comment #19
caiovlp commentedOh, and I missed your hardcoded comment. That's the API version and not an actual date, that value is what Twilio's php API is expecting.
Comment #20
misc commentedThe project page is short, and does not explain so much about how it works, what Twilio conferencing is etc. You should also say that it is needed to download the libraries (some of us forget to check the README files ;-))
You really should not place stuff in the modules inc folder, that is bad Drupal-practice, you should use the libraries folder for that - look into the libraries module, and also you should add the check for the Twilio libraries in the install file.
Comment #21
caiovlp commentedhttp://drupal.org/node/1086416#comment-6241650
http://drupal.org/node/1098972#comment-6241700
http://drupal.org/node/1221886#comment-6241710
Comment #22
misc commentedPlease tell us what you have done regarding #18. We need communication to get this going.
Comment #23
caiovlp commentedAll feedbacks have been taken into account, even the ones that are not application review blocker:
- Implemented hook_help.
- Implemented hook_requirements.
- Importing third party library through libraries module.
- Made sure all variables had the module name prepended.
- Enhanced project page.
- Removed code from Master and added README.txt
Comment #24
gregglesThere are several places where you check_plain on receiving variables before doing something else with them, like inserting into a database. check_plain has a specific purpose: removing xss attacks by encoding user-supplied data before printing that data in an html context (i.e. the browser). If you check_plain a variable when you receive it then your later use of the variable in a non-browser context might be incorrect. I suggest removing any check_plain of incoming variables and instead doing appropriate filtering when (if) those variables are printed back to the browser. See http://drupal.org/node/263002 and http://drupal.org/writing-secure-code for more details.
I also noticed that most of the callbacks take action (update and delete queries) based on user input but do not validate user intent - this is a CSRF vulnerability. The impact appears to be reduced by the fact that an attacker would have to know the callSid which seems likely to be private. However, it's best to protect these actions against CSRF. The typical way to do that in Drupal is by using tokens - either via the Form API or manual calls to drupal_get_token/drupal_valid_token. See http://drupalscout.com/tags/csrf for more details.
Comment #25
caiovlp commented@greggles - thanks for taking the time to look into my module in such a depth. Please see my comments below:
You're right, I'm not using check_plain for displaying HTML. However, these variables are sent to Twilio API through XML and this function makes sure they won't break the XML structure. Maybe I'm using the wrong function, I will look into it but this shouldn't be an issue.
I am checking every variable or using tokens as you suggested:
/twilio/check-for-updates/% - parameter is only used to compare if the UI is supposed to be changes, don't pose any security risk.
/twilio/mute-participant/%/%
first parameter: validated against user id.
second parameter:
// Prevent ill-intentioned users from causing any damage by
// changing the URL manually.
if ($muted != 'true' && $muted != 'false') {
$muted = 'false';
}
/twiml POST
This comes from Twilio's service, so the user is not able to spoof it. However, this is very secure as:
user_token - user token generated for every new session
call_sid - call token, provided by Twilio. If a user happen to hack this variable, he or she would be able to join a conference, that's it.
Hopefully my explanation is sort of evidence that I'm considering security when writing my code :)
Comment #26
gregglesFirst: I haven't installed the module b/c I don't want to setup a whole twilio account, so I apologize for not having full details of these ideas.
Security related issues
If you do need to use check_plain to format things before printing them in XML I suggest doing the check_plain just before printing as well.
For /twilio/mute-participant/%/% - I think you could trick a user with the permission "twilio_conferencing_conference_mute_others" into visiting the url and unmuting the line for someone else, right? To trick a user into visiting the url for my UID I could use an img with a src tag like src="http://example.com/twilio/mute-participant/36762/false".
How do you guarantee that it's coming from the service? What would prevent me as a malicious user from making POSTS to that url? It seems like the only damage is bad data in the database (and they'd have to guess the user_token, which is somewhat random) so it's not a huge deal to get more validation that this is from the Twilio server, but if there is some way you can do that, please consider it.
Other suggestions
I noticed you're creating the user_token with the md5 function. While md5 might be appropriate for this purpose, it's ideal if you can avoid it altogether (there are some environments where anything with an md5 in it is immediately rejected, so it's just easier to avoid). It also seems like there's not much real randomness in the hash. I suggest using drupal_get_token with a string like twilio_conference or similar.
One other note: the database table name of 'conference' is likely to conflict with other modules. I suggest twilio_conference or something similarly prefixed.
Comment #27
caiovlp commented@greggles - Thanks again for reviewing my module, your feedback were great!
/twilio/mute-participant/%/% - You're right... I've added a new parameter (user_token) so a malicious user would have to figure that parameter out and that's pretty much impossible.
What I meant when I said that the POST call comes from Twilio's service and that it couldn't be spoofed was that a malicious user wouldn't be able to intercept the transaction and get the tokens and ids to fake a request out. Without a valid CallSid paramater (a 34 character hash) this hook_menu would not update or do anything.
md5 - I didn't know that... But I do know that Drupal uses md5 to encrypt users' password so I feel comfortable using it.
Database table name has been changed - Great catch, I missed that.
Thanks again!
Comment #28
drupwash commentedHi @Misc,
I have test this module cloning from http://git.drupal.org/sandbox/caiovlp/1687816.git
I'm confused because repository which you have specified(http://git.drupal.org/sandbox/caiovlp/1509002.git) and which I tested(http://git.drupal.org/sandbox/caiovlp/1687816.git) completely different.
I'm not doing manual test again but the maintainer should think about the valid repository link in project page.
Comment #29
gregglesRegarding md5: it is no longer used in Drupal 7.
Comment #30
caiovlp commented@drupwash - I had to create a new sandbox and move the code to the new one. Please refer to this comment and the one before: http://drupal.org/node/1684418#comment-6239076
@greggles - You're right, but Drupal 7 core still uses md5:
I think this was done to migrate D6 users to D7 but still...
But I got the message and will try to avoid md5 in future implementations.
Thank you both for taking the time to manually review my project.
Comment #31
caiovlp commented@klausi - can you please review my application?
Thanks,
Caio
Comment #32
klausiPlease add your reviews of other projects to the issue summary as outlined in #1410826: [META] Review bonus.
There is still a master branch, make sure to set the correct default branch: http://drupal.org/node/1659588 . Then remove the master branch, see also step 6 and 7 in http://drupal.org/node/1127732
manual review:
require_once 'mymodule.inc';Although you should definitively fix those issues they are no application blockers, so I guess this is RTBC. Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #33
klausiNo objections in more than a week, so ...
Thanks for your contribution, caiovlp!
I updated your account to let you promote this to a full project and also create new projects as either a sandbox or a "full" project.
Here are some recommended readings to help with excellent maintainership:
You can find lots more contributors chatting on IRC in #drupal-contribute. So, come hang out and get involved!
Thanks, also, for your patience with the review process. Anyone is welcome to participate in the review process. Please consider reviewing other projects that are pending review. I encourage you to learn more about that process and join the group of reviewers.
Thanks to the dedicated reviewer(s) as well.
Comment #34.0
(not verified) commentedChanging the sandbox address