-
Notifications
You must be signed in to change notification settings - Fork 469
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
UVE: 🐛 Prevent Read-Only Token Access to Working Content #30991
Comments
I have been testing different users with “read-only” tokens, and the 401 response is not necessarily expected. Next, take a user created from scratch, assign only the back-end role, and grant “view” permissions for the site of interest. If you use the token immediately, you’ll get a 401. However, if you apply the changes in cascade, the token will now allow access to pages, and permissions should apply for filtering. That said, I encountered a bug when filtering content in the “working” state. The issue arises because the construction of one of the objects used for filtering is taking the system user instead of the logged-in user. |
These fixes were merged as part of the branch #31072 therefore it can be tested and no additional merge is required |
This is what I have been using for testing:
The bearer token blongs to a user that was created then assigned a front-end role only |
After conducting several test cases, it was determined that the issue is related to a caching problem, as the order in which the tests are performed directly impacts the results. To address this, a script was created to facilitate testing more cases in less time (attached). The following steps were followed:
Various scenarios were tested by requesting the page in FindingsThe following issue, which is very likely related to the ticket, was discovered: Using a Front-End token: Initial Request in LIVE mode without the publishDate query parameter: When requesting the page, the pageAPI responds correctly, displaying only the LIVE contentlets. Then Clearing Cache, After clearing the cache, the behavior changes: First Request in LIVE mode WITH the publishDate query parameter: It appears that when the page is requested, it gets "stored" in cache, and subsequent requests retrieve the cached version instead of rebuilding the page. This behavior seems to cause the issue when the publishDate query parameter is used. Additionally, this caching behavior seems to be why the unit test does not fail, as it’s likely that the cache does not affect the test environment. |
Blocker Found: ftm.mp4 |
Seems the FTM issue is not quite solved, yet. I fired up 25.02.07, and was initially seeing the same behavior that I had reported in my video from the Scout channel: https://dotcms.slack.com/archives/CQNF9PCFQ/p1738680630969759?thread_ts=1738610618.649869&cid=CQNF9PCFQ However, after a browser-cache-clearing hard refresh, it seems to have gone in the other direction: now the working version doesn't show up under any of the modes, including Live mode after the publishing date. Screen.Recording.2025-02-07.at.3.51.42.PM.mov |
it looks to me like the issue is Front-end TM-cache.mov |
I'll be investigating this issue that @fabrizzio-dotCMS is reporting to discard or confirm frontend issues. |
This is happening due to use of the Looks like the Image API is not taking in count the context of the Page it is being rendered at the moment. I recommend to dig into this in the backend side. |
Problem Statement
Read-only API tokens are incorrectly allowed to access the working content of pages with future date set in the Page API, violating access control policies and potentially exposing unpublished content prematurely.
Objectives
User Story
As an IT Security staff member, I want to ensure that read-only tokens can only access live content and not any working versions, so we can maintain content integrity and adhere to strict access policies.
Steps to reproduce
publishDate
in the future to see the content and a read only tokenAcceptance Criteria
External Links
[Placeholder for external links to Slack conversations, support tickets, Figma designs, etc.]
Assumptions & Initiation Needs
Quality Assurance Notes & Workarounds
[Placeholder for QA notes]
Technical Details
The API needs adjustments particularly in how permissions are verified for future-dated content requests.
Potential Challenges
Impact on Existing Features
Ensure that permission checks do not negatively impact legitimate user accesses or API response times.
The text was updated successfully, but these errors were encountered: