Closed (fixed)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
4 Jul 2012 at 19:49 UTC
Updated:
4 Jan 2014 at 02:05 UTC
Jump to comment: Most recent
Comments
Comment #1
brazorf commentedHello there,
1. Developement is under the master branch, you should switch the dev line in a standard named branch like 7.x-1.x and empty the master itself
2. You did not wrap text (@see .module:17 i.e.) in t(), so it's not localized
3. I'ts recommended to delete your variables in hook_uninstall, best practice is placing it in sneaky_menu_path.install file
4. I would suggest you to run ventral and fix those coding issues
Regards,
brazorf
Comment #2
caseyc commentedbrazorf, thanks for the review.
1. Done! Branch now at 7.x-1.x and master branch removed.
2. Woops! Done.
3. Added an uninstall function in a .install file
4. No errors reported with ventral now.
Thanks!
Comment #3
andyhawks commentedcaseyc,
$_SESSIONmanipulation necessary?Comment #4
caseyc commentedAndy, thanks for your feedback.
I considered making the name something along those lines - but aside from my fingers getting upset with me at the thought of typing "drush dl menu_path_validation_enforcement", I think it strikes on something bigger that's important. We aren't bypassing validation, per say. Just one aspect of it, right? So this was designed such that any other validation that is done - or will be done in the validate function will remain. We are just bypassing the relative url aspect of it. I don't know what other things we'd be validating there - but I don't want the module name to be misleading if something new is added to core.
So what would you name it in light of that?
I'll post to the thread regarding the 8.x core for review.
Regarding the SESSION manipulation - we considered a few different approaches and this was the simplest. What might you suggest as an alternative? Would really appreciate your thoughts.
Comment #5
andyhawks commentedcasey,
Yep
drush dl menu_path_validation_enforcementis long, maybe any_menu_path? all_your_menu_path_are_belong_to_us ?The Session manipulation isn't a big deal here, you're doing a simple set and unset here with trusted users. Since you're already storing and retrieving the 'sneaky' mlid array var between validation and submit though, I might've just
appended it to that variable - move the modified mlid's into a nested array and added an 'active' array of uid indexes or something. That's misusing variable_set, yeah, but avoiding session. But again, don't think it really matters.
This looks good to me, setting to RTBC and curious what the community will have to say!
Comment #6
clemens.tolboomRegarding $_SESSION
Why not use a #value form item and for validation and submitting use its value and set it though $form_state.
Regarding module name:
the module overrides/bypasses the validation and not enforces. Thus I like any_menu_path.
Comment #7
kerasai commentedRegarding $_SESSION
I think the cleanest thing to do would be to stick $form_state['values']['link_path'] into $form_state['storage']
There are also some other little things you can do to make the code "cleaner" but those are nit-picky. Nice job on the concept and figuring out how to make it work.
Comment #8
klausiWe 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 #9
caseyc commented@andyhawks - module name updated to any_menu_path which I agree is much more suitable, if a little less sneaky ;)
@bmoresafety20 - suggestion taken. Works like a charm.
@klausi - I'll review ASAP and message you when I'm through.
Comment #9.0
caseyc commentedUpdating repo to 7.x-1.x instead of master branch.
Comment #10
mitchell commentedGreat feedback here. Looks like people have really been waiting for this :)
Re module name:
IMHO, this is worth getting some positive feedback that hopefully matches the code reviews' sentiments before going live. I'm partial to making the module name prefix "menu_path" or "menu" and choosing the best concept id for its suffix. Here are a few suggestions: _nocheck, _any, _always_valid, ~_preexisting, or _placeholder. I like the latter most, ie menu_placeholder or menu_path_placeholder. Any Menu Path is descriptive, but I think following naming conventions has tons of benefits.
Re similar efforts (for collaboration sake. none are 'duplicate efforts', so this is good on that front):
I saw Menu Editor also referenced in #308263: Allow privileged users to bypass the validation of menu items. Could you please describe how your approach differs from that module's? This isn't a show stopper for your own work here, but maybe they could factor out that feature if that's what's keeping it unstable. Also, that core issue seems like it really needs some knowledgeable reviewers, so if you could weigh in there with an advisable approach and patch review, I'm sure the core maintainers would really appreciate it.
All in all, this is pretty much rtbc for me.
Comment #11
caseyc commentedThanks mitchell.
a. The Menu Editor module does not provide this feature. It was only mentioned in #308263: Allow privileged users to bypass the validation of menu items to point out that the Menu Editor module would only let you populate menus with content that did not yet exist. By contrast, our module is also meant to point to actual paths outside the Drupal root.
b. The ticket at #308263: Allow privileged users to bypass the validation of menu items is actually for Drupal Core and has been assigned to D8 since January, with requests not to change it back to D6 or D7. Kittens have been threatened. My client has a need for a D7 module. The core patch won't be backported until it's rtbc in D8. They don't have a stable patch yet and the last submission was in January.
Also, I've renamed my module to "any_menu_path" per the suggestions above (even though I realllly like sneaky_menu_path). ;)
Comment #11.0
caseyc commentedUpdated sneaky_menu_path to any_menu_path
Comment #11.1
caseyc commentedUpdating for Review Bonus program
Comment #12
caseyc commentedTagging for reviews bonus program.
Comment #13
klausiYou need to set the status to "needs review" if you want to get a review. See http://drupal.org/node/532400
Comment #14
caseyc commentedDone!
Comment #15
bhosmer commentedIt works as designed and does what it says.
Comment #16
klausimanual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #17
bhosmer commentedAt the risk of just shooting myself in the foot here, I'd like to add a vote that the module is useful. A denial based strictly on how many lines of code might not be a good trend to start towards.
If the module meets standards, has no security issues, and the applicant has shown they are a valuable member of the community, basing denial on an application based just on how many lines of code are in it should be reconsidered.
Comment #18
klausiWe do not deny short modules, where did you read that? (need to clarify the docs)
We just can't grant the git vetted user role. However, we can promote this single project manually to a full project for the applicant.
Comment #19
bhosmer commentedMy apologies, I misinterpreted this:
And I had derived some of it from this discussion: http://groups.drupal.org/node/195848
Comment #20
caseyc commented@klausi:
1) The project is now 170 lines of code after I've added some slick functionality.
2) I t()'d that string.
3) I disagree. It could not be set due to some error, some other contrib module doing things. Anyone can play with that variable in their own form_alter.
In thinking about it, the main reason I did this was so that I could see which paths were being overridden with my module. So I made a new menu_hook with a listing of overridden paths, available in the Configuration menu: admin/config/content/any_menu_path
(README updated accordingly)
This (and my new addition of some permission validation) has put my module over the 120 line threshold.
4) Good catch. Thanks! Fixed!
Comment #21
ruplThis is a great module and I'd really like to see it promoted to a full project. Couple of minor things I noticed:
Since none of the above points are show-stoppers in terms of proper module development, I'd say this is RTBC.
Comment #22
klausimanual review:
<script>alert('XSSmenu');</script>I get a nasty javascript popup on that page. You need to sanitize user provided input before printing if it has not been sanitized before. Please read http://drupal.org/node/28984 again.Comment #23
caseyc commented@rupl:
1) Thanks for the suggestion. Someone actually has brought this up before and I thought that it would be a bit misleading because it actually doesn't skip validation - you'll notice it just skips one part of the validation (the url). So I wouldn't want someone to think any other aspects of validation (especially extra ones provided by some other module in hook_validate) were being skipped.
2) Thanks for the feedback!
3) Done! Added to the module. Thanks for the suggestion.
@klausi
1) Sorry about that. Sloppy on my behalf - wasn't thinking. Fixed there and other places too.
2) Doh! I knew that! I was in all three security sessions at BADcamp too. Wasn't thinking there too. I'm trying to be much more mindful of XSS in my code, so thanks for pointing this out. I'll be hyper aware now.
Thanks for the help!
Comment #24
clemens.tolboomJust some core XREFs I know of. Maybe you can help with those?
- #1251188: Set unique titles for user/register, user/password, and user/login menu items
- #308263: Allow privileged users to bypass the validation of menu items
- #1337546: Cannot reorder 'User Menu' items for user/register user/login as these are not accessible by admin
Comment #25
caseyc commented@clemens.tolboom - once I get unvetted git commit access, my plan is to start contributing a few of the 30 modules I've developed for clients over the past several years.
I'd also like to start contributing to core issues. And when a client wants me to upgrade a module from d6 -> d7, I'm contacting the maintainer to be a co-maintainer (if the project status says it's looking for a co-maintainer).
I'd really like to see some good faith from the community though by approving this module first and giving me unvetted git commit access. I've done everything that's been asked of me and I've followed all the rules. I've patiently worked at this when I've been able since July, including completing the reviews bonus program.
I understand that this is the process, however it's starting to feel a bit defeating...and a bit like the community doesn't really want new contributions from new folks.
Comment #26
bhosmer commented@caseyc
I completely empathize with what you are feeling right now. I went through this same process almost a year ago with a module that I thought would be useful, only to have it denied because another module incorporated similar functionality, only with more complexity and other things the user might not want.
I just went through this same process again, and was approved this time for a different module.
I got frustrated like you the first time, and this second time the process was a little frustrating and discourage, but looking back I am thankful for the experience.
Please stick with it and keep trying.
Comment #27
caseyc commented@bhosmer - thanks for the encouragement! I'll keep at it!
What's the next step on this module? Everything should be in order right? Just needs to be approved and we're good to go?
Comment #28
bhosmer commented@caseyrc:
I did a PAReview for you for your latest updates: http://ventral.org/pareview/httpgitdrupalorgsandboxcaseyc1670304git-7x-1x
No errors! Congratulations!
I also downloaded and installed your latest update, and it works as designed.
Also, great forethought in adding this: admin/config/content/any_menu_path which adds that nice extra touch for usability.
Marking RTBC.
Now, if you do three more PAReviews, and no one else raises any issues, Your module should be approved within a week. You just have to be patient for the process.
Comment #29
caseyc commented@bhosmer - thanks!
Three more reviews completed (see page notes).
Comment #29.0
caseyc commentedChanging wording of review bonus explanation.
Comment #30
klausiThanks for your contribution, caseyc!
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 #31
caseyc commented@klausi, really appreciate it!
Comment #32
bhosmer commentedCongratulations!
Comment #32.0
bhosmer commentedUpdating with news review bonus review links.
Comment #33
clemens.tolboomYay :-)
Comment #34.0
(not verified) commentedAdded real project path