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

IBX-5852: Created a new layout for error pages to prevent leak data #2106

Merged
merged 2 commits into from
Aug 1, 2023

Conversation

mateuszdebinski
Copy link
Contributor

Question Answer
Tickets IBX-5852
Bug fix? yes
New feature? no
BC breaks? no
Tests pass? yes
Doc needed? no
License GPL-2.0

Changed the layout that error pages use so that by default they use as few of our components as possible and haven't too much data like window.ibexa

Checklist:

  • Coding standards ($ composer fix-cs)
  • Ready for Code Review

Copy link
Member

@glye glye left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure yet, please look into the hotspot alert.

var _jipt = [];
_jipt.push(['project', 'ezplatform']);
</script>
<script type="text/javascript" src="//cdn.crowdin.com/jipt/jipt.js"></script>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DO NOT COMMIT, just an example

Suggested change
<script type="text/javascript" src="//cdn.crowdin.com/jipt/jipt.js"></script>
<script type="text/javascript" src="//cdn.crowdin.com/version-x.y.z/jipt/jipt.js" integrity="sha384-ye83f7h4...etc"></script>

So this alert is not from this PR, but I'm trying to resolve it anyway. The subresource integrity check makes sense here. Making the hash is easy. But we need to lock it to a specific version of the JS code, so it doesn't break on the next update. I haven't yet found how crowdin would specify the version.
https://developer.mozilla.org/en-US/docs/Web/Security/Subresource_Integrity#tools_for_generating_sri_hashes

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

NB: This should not hold up this PR - but please look into it as a follow-up, if merged without a fix for this.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@glye I asked Crowdin about this and here is an answer:

"The team told me that we don’t have versions of jipt.js. Bug fixes or new features may be introduced to the file"

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. That's unfortunate. The only way to secure it is to bundle it, then, and ensure we update it during release cycles.

Anyway, this problem should not block this PR since it's pre-existing.

@sonarcloud
Copy link

sonarcloud bot commented Jul 20, 2023

SonarCloud Quality Gate failed.    Quality Gate failed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot E 1 Security Hotspot
Code Smell A 0 Code Smells

No Coverage information No Coverage information
5.6% 5.6% Duplication

idea Catch issues before they fail your Quality Gate with our IDE extension sonarlint SonarLint

Copy link
Member

@mnocon mnocon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. I've tested that we're not leaking any information through JavaScript objects
  2. Error pages in the Admin panel are working as intended

QA Approved!

@ViniTou ViniTou merged commit 0ceabb1 into 2.3 Aug 1, 2023
13 of 14 checks passed
@ViniTou ViniTou deleted the IBX-5852_prevent_leak_information_on_error_page branch August 1, 2023 14:04
@mateuszdebinski mateuszdebinski added the Doc needed The changes require some documentation label Aug 8, 2023
@MagdalenaZuba MagdalenaZuba removed the Doc needed The changes require some documentation label Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.