Closed (won't fix)
Project:
Drupal.org security advisory coverage applications
Component:
module
Priority:
Normal
Category:
Task
Assigned:
Unassigned
Issue tags:
Reporter:
Created:
12 Mar 2016 at 15:13 UTC
Updated:
29 Jul 2016 at 16:24 UTC
Jump to comment: Most recent
Comments
Comment #2
sourabhutani commentedComment #3
marabak commentedHello, first you should run all the automatic reviews with http://pareview.sh
Comment #4
marabak commentedWhy are you creating a new content type and many fields to store your video. Maybe you should add media and media video modules and add alter functions to modifiy them.
Comment #5
PA robot commentedWe 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 #6
sourabhutani commentedThanks @marabak for your suggestion.
1. I had run my module for automatic reviews on pareview.sh and fixed all issues take look by below link:
http://pareview.sh/pareview/httpgitdrupalorgsandboxsourabhutani2658790git
2. As I'm creating fields and content type by module because to create a schema i have to give individual fields of video details like(video title, desc, duration, link etc.) to user to fill up and these values generate a video schema in jsonld format.
Hope @marabak you understand the module requirement and features.
Thanks again for your time.
Comment #7
marabak commentedOk i understand.
You are adding a content type with data to create a schema for a video. But this video will be a media video or something else and not provided by your module and could reference your schema with entity reference for instance, just like profile2 for a user.
i saw in code that you are creating a block defined as appearing on every page :
and then in hook_block_view() you are checking if the current path is a video node path :
Maybe you should consider not to display your data as a block but alter the video node view with hook_node_view() instead.
Your are excluding the front page but what if the front page is a actually a video page ?
Comment #8
sourabhutani commentedComment #9
sourabhutani commentedThanks for your review @marabak.
I have used now hook_node_view in place of creating new block and it was a great help from your side.
Fixed pareview.sh issues. after updating code.
Please review.
Comment #10
abu-zakham commentedHello sourabhutani,
you missed a lot of code commented, like
// print_r($videodata);// $comma= '';you need to cleanup your code and write some real inline comments
Comment #11
sourabhutani commentedThanks @Abdulla Abu-Zakham for reviewing.
I have removed the unwanted comment from all files.
Please check and review again.
Comment #12
sandipauti commentedHey sourabhutani,
As reference to your above comment, still there is commented code. Is 'weight' need in future? if not please remove.
function video_schema_node_view($node, $view_mode = 'full', $langcode = NULL) {
if ($node->type == 'video') {
$node->content['schema_field'] = array(
'#markup' => _video_schema_block_video_data(),
// '#weight' => 10, .
);
}
return $node;
}
Regards,
Comment #13
sourabhutani commented@sandipauti unnecessary comment is removed as you suggested.
Thanks for reviewing my module.Please check and review again.
Comment #14
th_tushar commentedHi @sourabhutani,
I have manually reviewed your code. I have found the below issues.
(*) Please check if
$_GET['q']contains Drupal's node url i.e. "node/[nid]" and also check if$complete_url['1']is numeric. Else node load function will result in fatal error.(*) The data entered by user should be passed through
check_plain()orfilter_xss()functions to sanitize the data before submitting to database.Changing the status to "Needs work". Please fix the above issues and change the status back to "Needs review".
Comment #15
th_tushar commentedChanging the status to "Needs work".
Thanks for your contribution!!
Comment #16
klausi@th_tushar: no, data should NOT be sanitized when saved to 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
Make sure to read that article again.
Comment #17
th_tushar commentedHi @sourabhutani,
Ignoring #14, as per klausi comment.
I have manually reviewed your code. I have found the below issues.
(*) Please check if
$_GET['q']contains Drupal's node url i.e. "node/[nid]" and also check if$complete_url['1']is numeric. Else node load function will result in fatal error.Changing the status to "Needs work". Please fix the above issues and change the status back to "Needs review".
Comment #18
sourabhutani commentedThanks @th_tushar for your review.
I have changed the code as you suggested and it was a great help .Please check and update.
Thanks @klausi for your guidence.
Comment #19
sourabhutani commentedComment #20
sourabhutani commentedComment #21
th_tushar commentedHi @sourabhutani,
hook_node_info()to create a content type.hook_form_alter()function.Changing the status to "Needs work". Please fix the above issues and update the status back to "Needs review".
Comment #22
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 #23
sourabhutani commentedHi
@th_tushar Thanks for your review . I really appreciate issues that you raised.
Now i have changed the concept of my module. It will create a field type and can be added to any custom content type.
Thanks!
Comment #24
sourabhutani commentedComment #25
sourabhutani commentedComment #26
namit.garg commentedHi
I found you have changed your concept from creating custom content type to field type. That is a good approach. In my case schema is creating when i set up multiple values to 1. When i increased multiple values http://screencast.com/t/2z0XWFipUf7 to greated than 1. It doesn't assume other fields and create schema for first field. Please have a look.
Thanks!
Comment #27
namit.garg commentedComment #28
sourabhutani commentedHi namit
Thanks for your review.
I have updated the code. Please check .
Comment #29
sourabhutani commentedComment #30
klausiReview of the 7.x-1.x branch (commit 22372b8):
This automated report was generated with PAReview.sh, your friendly project application review script. You can also use the online version to check your project. You have to get a review bonus to get a review from me.
manual review:
Removing review bonus tag, you can add it again if you have done another 3 reviews of other projects.
Comment #31
heykarthikwithuYes, this is having a cross-site scripting (XSS) vulnerability.
After adding the Video schema field type to a content type and while adding the node of that particular content type, if we place the javascript in the video scheme field. And save the node.
We can see the javascript code is been injected, on viewing the node.
Comment #32
heykarthikwithu@klausi, assigning back to you, to have a check on my review.
Comment #33
klausiThat's right, it is also a good idea to tell the applicants where the vulnerability should be fixed.
video_schema_getproperdata(): user provided text must be sanitized before printing to HTML. Make sure to read https://www.drupal.org/node/28984 again.
Comment #34
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.