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

Implemented admin auth origin check #15135

Merged
merged 7 commits into from
Aug 3, 2022

Conversation

SimonBackx
Copy link
Contributor

@SimonBackx SimonBackx commented Aug 3, 2022

refs https://github.com/TryGhost/Team/issues/1694

  • Added replacements option to @tryghost/minifier + updated documentation and name of 'options' param which was a bit confusing.
  • At compile time, we'll replace '{{SITE_ORIGIN}}' with the actual and JS encoded origin string.
  • Block requests to the auth frame with the wrong origin, but log a warning for now to make debugging easier.

Question:

  • Are we 100% sure that the Ghost site is always hosted on the url which is configured in the site config? Because locally, it also doesn't redirect to the configured site. Technically, it is possible to host it on a different domain, no?

@codecov
Copy link

codecov bot commented Aug 3, 2022

Codecov Report

Merging #15135 (91fd711) into main (59c750a) will increase coverage by 0.00%.
The diff coverage is 72.72%.

❗ Current head 91fd711 differs from pull request most recent head 9378f88. Consider uploading reports for the commit 9378f88 to get more accurate results

@@           Coverage Diff           @@
##             main   #15135   +/-   ##
=======================================
  Coverage   58.09%   58.10%           
=======================================
  Files         734      734           
  Lines       61658    61694   +36     
  Branches     5360     5362    +2     
=======================================
+ Hits        35820    35846   +26     
- Misses      25787    25798   +11     
+ Partials       51       50    -1     
Impacted Files Coverage Δ
...ore/frontend/services/admin-auth-assets/service.js 50.45% <36.84%> (-2.23%) ⬇️
ghost/minifier/lib/minifier.js 100.00% <100.00%> (ø)
...core/core/frontend/services/rendering/templates.js 60.69% <0.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

SimonBackx added a commit to TryGhost/comments-ui that referenced this pull request Aug 3, 2022
refs https://github.com/TryGhost/Team/issues/1694

- Only listen to messages that are coming from the auth iframe
- Related PR for the other side: TryGhost/Ghost#15135
@SimonBackx SimonBackx marked this pull request as ready for review August 3, 2022 13:07
@SimonBackx SimonBackx requested a review from allouis August 3, 2022 13:08
Copy link
Contributor

@allouis allouis left a comment

Choose a reason for hiding this comment

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

We also need to pass the origin to the postMessage call as the second argument, rather than '*'

@SimonBackx SimonBackx requested a review from allouis August 3, 2022 13:52
refs https://github.com/TryGhost/Team/issues/1694

- Added replacements option to the minify package
- At compile time, we'll replace '{{SITE_ORIGIN}}' with the actual and JS encoded origin string.
- Block requests to the auth frame with the wrong origin, but log a warning for now to make debugging easier.
@SimonBackx SimonBackx merged commit e1bee3c into TryGhost:main Aug 3, 2022
@SimonBackx SimonBackx deleted the admin-auth-security branch August 3, 2022 13:59
daniellockyer pushed a commit that referenced this pull request Jun 22, 2023
refs https://github.com/TryGhost/Team/issues/1694

- Only listen to messages that are coming from the auth iframe
- Related PR for the other side: #15135
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants