Closed (fixed)
Project:
MP3 Player
Version:
6.x-1.x-dev
Component:
Miscellaneous
Priority:
Normal
Category:
Bug report
Assigned:
Reporter:
Created:
25 Jul 2013 at 15:54 UTC
Updated:
29 Jan 2014 at 23:20 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #1
markie commentedAttached is a patch with a possible resolution to the XSS issue. I've moved the swf file to the libraries to separate the projects.
Comment #2
gregglesHere's the original bug report. Now that it's been a pretty long time since the SA was made public it seems OK to post it here.
It seems you got some of the problem but not all of it.
Note also that the patch proposed below relies on validating inputs and while that's certainly a good idea, the Drupal standard is to also filter on output.
Comment #3
markie commentedGreggles
Thanks for working with me on this. Here's another patch that resolves the issues. I also did some code overhauls that were ticking me off. Please let me know what you think.
Comment #4
gregglesThat makes it much harder to review the patch and should be split to a "code cleanup" issue that gets committed after the security path :/
I suggest that you get a plan together to fix this issue and the other two issues as simply as you possibly can and make a release based on that. Then you can have other issues ready to go that fix other things. Make sense?
Comment #5
markie commentedMakes perfect sense and as I thought about this last night, I assumed this would be the case. I reverted back to the original and added just the hex checks and library move to this patch. Thanks for your patience.
Comment #6
gregglesSummarizing irc conversation - this still needs to filter on output - https://drupal.org/node/263002
Comment #7
markie commentedadded checkplain to edit form and output as well as other changes in previous patche.
Comment #8
markie commented@greggles: Is this going to happen or should I punt this to github?
Comment #9
greggles@markie the patch in #7 includes a fair bit of changes unrelated to security which makes it hard to review. I'm sorry if this process is frustrating for you. It's hard for me to prioritize a review of this module since I don't use it. I did add this issue to the project page to try to get more reviews/eyeballs from other users of the module.
I tried to review it and I think the check_plaining you're doing and I can see how the changes help to centralize that function to make it easier.
If that is truly a url I suggest using url() on it as that function includes some appropriate sanitizing. filter_xss isn't useful on random hunks of text, it only works on fully formed html. See http://drupalscout.com/knowledge-base/using-filter-functions-intended-fi... for an explanation with more details on when to use filter_xss or not.
From a security perspective: were you able to exploit the XSS issue and get a popup? Did you then test the changes post-patch and confirm that the xss no longer executed?
Thanks for your patience.
Comment #10
markie commented@greggles: Thanks for the feedback. I was getting frustrated because of a lack of movement. I appreciate you going out of your way to work with me on this. I apologize for the large amounts of differences on this module. I had to move things around to get it working in a way I could grock. If I were given VCS access I could be more iterative in my commits which could be easier. I don't want to release it till we all are happy, but I want to start tracking my changes. As far as the two points you bring up:
Again, thanks for your help on this.
Comment #11
gregglesThanks for the explanations.
1. filter_xss is definitely not the right thing for a path. I suggest either running filter_xss later when it is a fully formed html OR running url() or some other function that turns paths into urls and incorporates some sanitization.
2. I think for testing it would be fine to mess with the database values.
3. Sounds great!
Comment #12
markie commented@greggles
I was able to update the patch as requested. There are still a lot of changes that don't pertain exclusively to the security issue, but I would like to point:
1) I was able to test the XSS venerability using the db update and changing the function to url() ad requested kills the player, producing a text error. Of course if someone has access to the database like this, there are more problems in our world.
2) I was able to hard code a tpl file to insert the venerability using the code suggested in the README.txt
This also was captured and returns a text message.
3) Using the same code, but adding a few more evils, I was able to replicate the xss venerability and filter it out in the theme:
I think the important bits that you want to see are starting on line 352 of the attached patch. Please let me know if you have any questions.
Comment #13
gregglesGreat, glad you were able to reproduce the problem.
From my perspective this seems as good as it can reasonably get. I'd like to keep it at needs review for someone else who uses mp3player module to test out the patch.
Comment #14
markie commented@greggles can I get commit access so I can push a 7.x branch?
Comment #15
gregglesSure. Done. Please don't create a stable release for a few weeks so we can try to get more testers.
Comment #16
dandaman commentedCould we get a dev release or two up and available? It'd be much easier to test the latest dev version if I can download from Drush or directly from the web instead of having to do some Git checkout commands. Thanks!
Comment #17
greggles6.x-1.x dev is at https://drupal.org/node/352937 which is visible under the "all releases" link on the project page.
@markie - making a 7.x-1.x-dev seems fine to me - your call on whether or not to do it, of course.
Comment #18
markie commented@greggles - I am testing the 7.x branch this week and will make a dev release.. Also started an 8.x release during badcamp so that could be up as well. Any chance I could get permission to edit the project page so I can update the instructions on loading the libraries module? There seems to be confusion and I would like to document it properly.
Comment #19
dandaman commentedgreggles,
I may be reading the "Commit Log" page wrong, but it seems most of the security fixes and features committed have been committed to a 6.x-2.x branch, so I don't think the 6.x-1.x-dev download will have those fixes.
I may get a chance later to pull from Git and test things out.
Thanks!
Comment #20
gregglesFair enough. @markie - same advice applies to 6.x-2.x-dev.
Comment #21
dandaman commentedI checked out 6.x-2.x-dev from Git. Here's a couple things I found:
First, on node page with a filefield getting the mp3 display, there is this PHP warning being thrown:
Also, in mp3player.module on line 89, there is debugging function that should be deleted:
Comment #22
markie commented@dandaman - I started a new issue for separate tracking https://drupal.org/node/2139711. Thanks for looking into it. I also created dev branches for easier updating (and issue tracking)
Comment #23
markie commented@greggles: Can you open this project to me so I can update the front page content? I'll not make any stable releases until we get the clear, but I would love to be able to fix the documentation to include the libraries requirement and other text.
Comment #24
gregglesSure, done.
Comment #25
markie commented