Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
18 Aug 2016 at 13:47 UTC
Updated:
31 Mar 2017 at 16:25 UTC
Jump to comment: Most recent, Most recent file
Comments
Comment #2
PA robot commentedThere are some errors reported by automated review tools, did you already check them? See http://pareview.sh/pareview/httpsgitdrupalorgsandboxsahilkhambra2774499git
Fixed the git clone URL in the issue summary for non-maintainer users.
We are currently quite busy with all the project applications and we prefer projects with a review bonus. Please help reviewing and put yourself on the high priority list, then we will take a look at your project right away :-)
Also, you should get your friends, colleagues or other community members involved to review this application. Let them go through the review checklist and post a comment that sets this issue to "needs work" (they found some problems with the project) or "reviewed & tested by the community" (they found no major flaws).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #3
nitesh pawar commentedComment #4
weshare commentedAUTOMATED REVIEW
There is some coding standard errors to fix:
http://pareview.sh/pareview/httpsgitdrupalorgsandboxsahilkhambra2774499git
Individual user account
Yes
Master Branch
Yes: Follows
3rd party assets/code
Yes: Follows
README.txt/README.md
No: Please add a README.txt or README.md file.
Code long/complex enough for review
Yes. Well documented.
Secure code
Yes: None security issue found. Looks good.
Comment #5
klausiAt least the function names should be fixed from the automated review, can you do that @Nitesh Pawar?
Comment #6
sahil khambra commentedHi Klausi,
I have fixed the function name.
http://pareview.sh/pareview/httpsgitdrupalorgsandboxsahilkhambra2774499git
Soon i'll fix all pareview warnings and errors.
Comment #7
sahil khambra commentedComment #8
arulan_pari commented@Sahil Khambra
Add readme file for your module.
https://www.drupal.org/node/2181737
Comment #9
nisith commentedHi @Sahil,
In custom_sitename.module :
Example : In line 307 drupal_set_message(t($sitename_data['sitename'] . ' has been deleted.'));
Please use t() functions for text arguments in order to make it translatable.
Thanks,
Nisith
Comment #10
nisith commentedComment #11
sahil khambra commentedHi All
I have added the README.txt file.
Hi @Nisith,
Thanks for the update. I have added extra parameter in t() function to sanitize the variable.
Comment #12
sahil khambra commentedHi All,
I have fixed all the errors and warning as per the pareview.sh
http://pareview.sh/pareview/httpsgitdrupalorgsandboxsahilkhambra2774499git
Comment #13
arun ak commentedHi Sahil Khambra,
I did a manual review of your code and installed this module in local. Please see my comments below:
<script>alert('XSS');</script>" inside sitename field. It seems like XSS vulnerability and an application blocker. Usecheck_plain()/filter_xss()function to sanitize data before displaying. In admin pages you can usefilter_xss_admin()to sanitize values.Thanks,
ARUN AK
Comment #14
sahil khambra commentedDear ARUN AK,
Thanks for the code review. I have updated the changes mentioned by you.
1. Sanitize data- filter_xss()
2. Configuration URL aded to info file.
3. Validation error fixed.
4. Error changed to:- Sitename for the given URL already exit with alias !value
Again thanks for your suggestions.
Comment #15
arun ak commentedYou mean the error message
?
please don't remove the security tag, we keep that for statistics and to show examples of security problems.
Comment #16
kannan@kiluvai.com commentedI was manually reviewed your module, as said in comment #13, still the code is not sanitized,
I tried setting site name as
<script>alert('XSS');</script>and saved, immediately alert is triggered. When i navigated to page also, i got the alert.But in the comment #14, you have mentioned that you did sanitization.
Whatever you mentioned in comment #14 is not in the git repository.
when i check the git log your last commit message is " sahil: change in menu callback"
I think you need to check your git, whether you pushed the latest changes to repository.
Comment #17
kannan@kiluvai.com commentedgit log shows your last commit
Comment #18
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.
Comment #19
sahil khambra commentedComment #20
sahil khambra commentedComment #21
sahil khambra commentedHi Kannan,
Thank you for the information. Apologies for the late commit. Now the code is up to date.
Comment #22
rajat4u commentedHi,
File custom_sitename.module
1. Line 148, 150, etc
We can use single qoute instead of double
2. Line 149, 151
We can remove double qoute from $value->id
3. Line 347
We can directly return $query->execute()->$fetch_type(), no need of $result variable.
Comment #23
klausi@rajat.dkte: Double quotes vs. single quotes and variable usage alone is surely not an application blocker. Anything else that you found or should this be RTBC instead?
Comment #24
rajat4u commentedHi klausi ,
It should be in RTBC.
Comment #25
khurram_awan commentedHi @sahil-khambra
This module works fine for me. But one suggestion, I think list of all the sites name on edit page (/admin/config/system/custom_sitename/edit/[ID]) is bit confusing.
Thanks,
Khurram
Comment #26
sahil khambra commentedHello khurram,
Can u please elaborate what which part of the url is confusing.
Kindly suggest on the same, I will be more happy to incorporate those changes :)
Thanks,
Sahil
Comment #27
poojasharmaece commentedHi Sahil Khambra,
Module looks good , my findings are :
1: do not use filter_xss() on values that are inserted into the database. "When handling data, the golden rule is to store exactly what the user typed. When a user edits a post they created earlier, the form should contain the same things as it did when they first submitted it. This means that conversions are performed when content is output, not when saved to the database" from https://www.drupal.org/node/28984
2: If i am saving
><a href="http://www.google.com">fishing<</a>as site name and then on click of fishing its redirecting to google .comSo You need to sanitize data before printing. For more information about sanitizing, please read https://www.drupal.org/node/28984.
Comment #28
sahil khambra commentedHi Pooja Sharma,
Thank you for the suggestion.
I think it will be fine to store sanitise data in the db.
second point is resolved.
Comment #29
shreya shetty commentedHi ,
It works all fine. Changing status to RTBC.
Comment #30
poojasharmaece commentedPlease use % or @ instead of ! placeholder.
The placeholders (e.g. '%value' or '@value') are passed as plain-text and will be escaped when inserted into the translatable string. You can disable this escaping by using placeholders of the form '!value' but only if you are sure that the string is safe.
(https://www.drupal.org/node/28984)
Comment #31
sahil khambra commentedFirst thing It's not a road block, I have been through to that URL and I know the string will be safe because it is just a URL.
Comment #32
manuel.adanHi Sahil,
Your module provides an interesting functionality, but I think it can be achieve by using other existent components. Site name can be enclosed as a block, actually that's the default in D8. blockify module provides a block for a lot of common display components like the site name, site slogan or the page title. Then you can control the main site name visibility block with visibility settings, and add some other custom block as an alternative where needed.
Never the less, the site name is an important variable for a website that should remain constant for a same domain name. You may consider the powerfull domain module. With it, you can create several subdomains for one drupal installation, with custom settings each one, like the site name.
Review from site-builder point of view
Comment #33
manuel.adanComment #34
sahil khambra commentedHi Manuel,
Thanks for the suggestions. I'll start working on the same although it may take some time cause I am occupied with the existing projects.
Thanks,
Sahil
Comment #35
ankush_03HI Sahil Khambra,
Please fix space warning from your module file.
Comment #36
PA robot commentedClosing due to lack of activity. If you are still working on this application, you should fix all known problems and then set the status to "Needs review". (See also the project application workflow).
I'm a robot and this is an automated message from Project Applications Scraper.