? ? Pending

User tests: Successful: Unsuccessful:

avatar zero-24
zero-24
31 May 2022

Pull Request for Issue #37461

Summary of Changes

Improve nonce generation and add the nonce to included files too as well as improve generation

Testing Instructions

First test

  • enable the nonce generation as well as the CSP with report only
  • check that the nonces are only added to inline style and inline scripts
  • apply the patch
  • note that the nonce is also added to JS / css files included locally

IMPORTANT: When you are checking the HTML with the nonce present in the header modern browsers will alter the sourcecode generated and remove the actuall nonce but only keep the nonce keyword. This is correct and shows that it worked correctly.

seccond test

  • disable the nonce generation
  • check that the nonces are added to inline JS and css
  • apply the patch
  • check that with that patch it is no longer added to inlinestyle and inlinejs with the nonce option disabled.

Actual result BEFORE applying this Pull Request

  • Nonces are always set even when its not used in the CSP
  • Nonces are only set to the inline js and inline css

Expected result AFTER applying this Pull Request

  • Nonces are only rendered when also used within the CSP
  • Nonces are also added to included JS files

Documentation Changes Required

n.a.

cc @sisko1990

avatar zero-24 zero-24 - open - 31 May 2022
avatar zero-24 zero-24 - change - 31 May 2022
Status New Pending
avatar joomla-cms-bot joomla-cms-bot - change - 31 May 2022
Category Libraries Front End Plugins
avatar gopitzohlsen
gopitzohlsen - comment - 2 Jun 2022

With nonce enabled, I get nonce values in the style-src directive without configuring {nounce} placeholder inside the style-src directive.
With nonce disabled, I get no nonces inside the style-src directive.

avatar richard67
richard67 - comment - 13 Jun 2022

With nonce enabled, I get nonce values in the style-src directive without configuring {nounce} placeholder inside the style-src directive. With nonce disabled, I get no nonces inside the style-src directive.

@gopitzohlsen Does that mean you have successfully tested this pull request? If so, could you go to the issue tracker here https://issues.joomla.org/tracker/joomla-cms/37942 and use the blue "Test this" button at the top left corner? Just use the button, then select your test result and then submit. Thanks in advance.

avatar gopitzohlsen gopitzohlsen - test_item - 13 Jun 2022 - Tested successfully
avatar gopitzohlsen
gopitzohlsen - comment - 13 Jun 2022

I have tested this item successfully on 01e315a


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37942.

avatar viocassel viocassel - test_item - 14 Jun 2022 - Tested successfully
avatar viocassel
viocassel - comment - 14 Jun 2022

I have tested this item successfully on 01e315a


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37942.

avatar Quy Quy - change - 14 Jun 2022
Labels Added: ?
avatar Quy Quy - alter_testresult - 14 Jun 2022 - gopitzohlsen: Tested successfully
avatar Quy Quy - alter_testresult - 14 Jun 2022 - viocassel: Tested successfully
avatar Quy Quy - change - 14 Jun 2022
Status Pending Ready to Commit
avatar Quy
Quy - comment - 14 Jun 2022

RTC


This comment was created with the J!Tracker Application at issues.joomla.org/tracker/joomla-cms/37942.

avatar bembelimen
bembelimen - comment - 18 Jun 2022

Same here, will move to 4.2. Thx

avatar bembelimen bembelimen - change - 18 Jun 2022
Labels Added: ?
avatar richard67 richard67 - change - 18 Jun 2022
Title
[4.1] Improve nonce generation and add the nonce to included files too as well as improve generation
[4.2] Improve nonce generation and add the nonce to included files too as well as improve generation
avatar richard67 richard67 - edited - 18 Jun 2022
avatar roland-d roland-d - change - 18 Jun 2022
Labels Added: ?
Removed: ?
avatar roland-d roland-d - change - 18 Jun 2022
Status Ready to Commit Fixed in Code Base
Closed_Date 0000-00-00 00:00:00 2022-06-18 17:18:55
Closed_By roland-d
avatar roland-d roland-d - close - 18 Jun 2022
avatar roland-d roland-d - merge - 18 Jun 2022
avatar roland-d
roland-d - comment - 18 Jun 2022

Thanks everybody

Add a Comment

Login with GitHub to post a comment