Repository navigation
FOUR-34533 Severe Vulnerability - Unauthenticated Access to Protected REST API Endpoints from Public Web Entry - #9203
devmiguelangel wants to merge 4 commits into
Conversation
PR SummaryHigh Risk Overview A custom
Feature tests in Reviewed by Cursor Bugbot for commit 47e5ef9. Bugbot is set up for automated code reviews on this repo. Configure here. |
|
QA server K8S was successfully deployed https://tenant-1.ci-c02f0e872e.engk8s.processmaker.net |
1 similar comment
|
QA server K8S was successfully deployed https://tenant-1.ci-c02f0e872e.engk8s.processmaker.net |
|




Issue & Reproduction Steps
Anonymous Web Entry pages were issuing a Passport API cookie (
laravel_token) for the shared anonymous system user. Everyauth:apiendpoint accepted that cookie, so an anonymous visitor could use the API as that account and reach data belonging to other anonymous submissions, plus resources that only require "is authenticated".To check: open an anonymous Web Entry in a private window and look at the cookies. Before this change a
laravel_tokenis present; after it, there is none. Calling coreauth:apiendpoints (requests, tasks, screens) with an anonymous session now returns 401.Solution
Middleware\CreateFreshApiToken(extends Passport's), used in thewebgroup inbootstrap/app.php. It never issues the API cookie to the anonymous identity and expires a stale one.ProcessMakerAuthenticate: the anonymous identity gets 401 onauth:apiroutes that don't list theanonguard. This also covers cookies issued before the fix and every package route behindauth.AnonymousUser::isAnonymousIdentity()shared by both checks;LoginController::keepAliveuses it too.anon(auth:web,anon,auth:api,anon, i.e. Web Entry) and regular users' cookies are unchanged.tests/Feature/Auth/AnonymousApiTokenTest.php.How to Test
./vendor/bin/phpunit tests/Feature/Auth/AnonymousApiTokenTest.phptests/Feature/Auth,AuthTest,Api/ProcessRequestsTest,Api/TasksTest,Api/ScreenTest,TaskControllerTest.laravel_tokencookie;/api/1.0/requests|tasks|screensreturn 401; a logged-in user still gets the cookie and the app works.Related Tickets & Packages
FOUR-34533
https://github.com/ProcessMaker/package-webentry/pull/307
https://github.com/ProcessMaker/package-collections/pull/507
Code Review Checklist
ci:package-webentry:FOUR-34533
ci:package-collections:FOUR-34533
ci:deploy
.