Repository navigation
fix(proxy): refuse the ExApp lifecycle endpoints like HaRP - #1168
Conversation
8841e2c to
d2d4d59
Compare
|
No actionable comments were generated in the recent review.
|
There was a problem hiding this comment.
Actionable comments posted: 1

Review info
-
Run configuration-
- Source mode: Auto
- Repository: Unavailable
- Branch: Unavailable
- File: No configuration file from this repository applied
- Commit: Unavailable
- Layers: Organization UI
- Review profile: CHILL
- Plan: Advanced
- Run ID:
59addb55-7215-42fc-9673-1b4f7bd8ceb8
Files selected for processing: 4-
CHANGELOG.mdlib/Controller/ExAppProxyController.phptests/php/Controller/ExAppProxyControllerTest.phptests/psalm-baseline.xml
Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.
-
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
d2d4d59 to
b145bc3
Compare
HaRP refuses a user's request to the endpoints that only AppAPI calls on an ExApp (
/heartbeat,/initand/enabled), but the PHP ExApp proxy forwarded them whenever a route of the ExApp matched, for example a catch-all.*route. The proxy signs every request it forwards, so the ExApp ran its init or enabled handler for a request that did not come from AppAPI, for any user the route allowed.The proxy now answers 404 for these paths (HaRP drops the connection). It compares the path as the ExApp may read it: cut at a percent-encoded
?or#(the proxy forwards the path up to there), decoded once (FastAPI and other Python servers decode the path before routing), in any case and with slashes or newlines around it (Express matches/Init/to an/initroute by default; Starlette's route patterns end with$, which in Python also matches before a final newline). Dot segments are already refused by the check before it (#1163).An ExApp that probes its own
/heartbeatthrough the proxy, for monitoring or as a setup check, is refused now, as through HaRP; a monitor should call another public route of the ExApp instead, such as a/healthroute the ExApp may need to add.Changes
/heartbeat,/initand/enabledbefore it looks for a route.