Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[4.0] Issue warnings when unsafe-inline or unsafe-eval are used in auto mode #29602

Merged
merged 10 commits into from Jun 16, 2020

Conversation

zero-24
Copy link
Contributor

@zero-24 zero-24 commented Jun 14, 2020

Summary of Changes

Issue warnings when unsafe-inline or unsafe-eval are used in auto mode

Testing Instructions

  • apply this patch
  • switch com_csp in detect mode
  • visit the frontend with eval and or inline css usage
  • publish the collected reports about unsafe-inine / unsafe-eval
  • switch com_csp to auto mode

Expected result

You get a warning as this bypasses the CSP

image

Actual result

You get no info about that bypass.

Documentation Changes Required

Yes.
https://help.joomla.org/proxy?keyref=Help40:Components_CSP_Reports_Options && https://help.joomla.org/proxy?keyref=J4.x:Http_Header_Management

Acknowledgements

Warnings / Message text based on https://csp-evaluator.withgoogle.com/
'unsafe-inline' allows the execution of unsafe in-page scripts and event handlers.
'unsafe-eval' allows the execution of code injected into DOM APIs such as eval().

@zero-24 zero-24 added this to the Joomla 4.0 milestone Jun 14, 2020
@joomla-cms-bot joomla-cms-bot added Language Change This is for Translators PR-4.0-dev labels Jun 14, 2020
zero-24 and others added 3 commits June 14, 2020 22:13
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@richard67
Copy link
Member

@zero-24 Is it correct that I first have to change the mode from "Detect" to "Automatic" before publishing the reports? When still in detect mode I don't get the new warnings. If this is correct, then your PR works as intended.

@richard67
Copy link
Member

richard67 commented Jun 14, 2020

Ah I see I get the message also in the reverse order, when I publish the reports and then change the mode. I get them with mode change then. Makes sense to me and I think it is right.

@richard67
Copy link
Member

I have tested this item ✅ successfully on 701cab1


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

@richard67
Copy link
Member

@zero-24 Maybe you should add the step to change mode from "Detect" to "Automatic" to your testing instructions. It is currently missing there. The title of the PR tells it too, so at the end I found it out. But for other testers it's maybe more easy to test then.

@zero-24
Copy link
Contributor Author

zero-24 commented Jun 14, 2020

Done.

@ceford
Copy link
Contributor

ceford commented Jun 15, 2020

I have tested this item ✅ successfully on 701cab1

I changed the image in Help4.x:Components CSP Reports Options, also appearing in J4.x:Http Header Management, for one showing the message and a list of reports.


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

@joomla-cms-bot joomla-cms-bot removed this from the Joomla 4.0 milestone Jun 16, 2020
@jwaisner
Copy link
Member

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 16, 2020
@richard67
Copy link
Member

@jwaisner Did you notice @Quy 's review comments above?

@richard67
Copy link
Member

richard67 commented Jun 16, 2020

@zero-24 After last corrections I get only with patch applied:

j4-pr-29602_error

@richard67
Copy link
Member

@Quy Seems you have forgotten to remove the closing bracket, too, in your suggested changes. See my previous review comments and the screenshot.

@richard67
Copy link
Member

Back to pending.


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

@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jun 16, 2020
zero-24 and others added 2 commits June 16, 2020 16:43
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
Co-authored-by: Richard Fath <richard67@users.noreply.github.com>
@richard67
Copy link
Member

I have tested this item ✅ successfully on 38e3442


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

@richard67
Copy link
Member

One more test needed.

@Quy
Copy link
Contributor

Quy commented Jun 16, 2020

I have tested this item ✅ successfully on 38e3442


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

@Quy
Copy link
Contributor

Quy commented Jun 16, 2020

RTC


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

@joomla-cms-bot joomla-cms-bot added the RTC This Pull Request is Ready To Commit label Jun 16, 2020
@zero-24 zero-24 added this to the Joomla 4.0 milestone Jun 16, 2020
@wilsonge wilsonge merged commit e375092 into joomla:4.0-dev Jun 16, 2020
@joomla-cms-bot joomla-cms-bot removed the RTC This Pull Request is Ready To Commit label Jun 16, 2020
@wilsonge
Copy link
Contributor

Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

8 participants