Skip to content

fix(proxy): refuse the ExApp lifecycle endpoints like HaRP - #1168

Merged
oleksandr-nc merged 1 commit into
mainfrom
fix/proxy-internal-endpoints
Oct 26, 2026
Merged

oleksandr-nc merged 1 commit into
mainfrom
fix/proxy-internal-endpoints

Conversation

@oleksandr-nc

@oleksandr-nc oleksandr-nc commented Oct 26, 2026 •

Copy link
Copy Markdown
Contributor

HaRP refuses a user's request to the endpoints that only AppAPI calls on an ExApp (/heartbeat, /init and /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 /init route 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 /heartbeat through 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 /health route the ExApp may need to add.

Changes

  • The proxy refuses /heartbeat, /init and /enabled before it looks for a route.
  • Tests for the refused paths and for paths that only look alike.

@coderabbitai

coderabbitai Bot commented Oct 26, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review.

Recent 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: 68cc71b1-9a5d-4f34-8d60-7a5059daf076
Commits

Reviewing files that changed from the base of the PR and between d2d4d59 and b145bc3.

Files selected for processing: 3
  • CHANGELOG.md
  • lib/Controller/ExAppProxyController.php
  • tests/php/Controller/ExAppProxyControllerTest.php
Files skipped from review as they are similar to previous changes: 1
  • CHANGELOG.md

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 1 remain after this review.

Walkthrough

The ExApp proxy now rejects requests whose normalized paths match heartbeat, init, or enabled. The change logs the rejection and returns null, which uses the existing not-found path. Tests cover endpoint path variants and confirm that heartbeats and api/enabled are forwarded.

Priority: Normal

Merge Risk: Moderate · up to b145b

The proxy can still forward lifecycle endpoint variants to Tomcat-backed ExApps, so this should be resolved before merging.

Pre-merge checks: Passed 4 · Failed 1

Failed Failed checks: 1 warning

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 … Write docstrings for the functions missing them to satisfy the coverage threshold.
Passed Passed checks: 4 passed
Check name Status Explanation
Title check Passed The title names the main change: the PHP ExApp proxy now refuses the ExApp lifecycle endpoints (/heartbeat, /init, /enabled) to match HaRP. The changeset adds this check in ExAppProxyController::prepa…
Description check Passed The description is directly related to the changeset. It explains that the PHP ExApp proxy forwarded /heartbeat, /init and /enabled paths, and that the change now returns 404 for them. It describes th…
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Full details: Title check

Explanation

The title names the main change: the PHP ExApp proxy now refuses the ExApp lifecycle endpoints (/heartbeat, /init, /enabled) to match HaRP. The changeset adds this check in ExAppProxyController::prepareProxy, a CHANGELOG entry, and tests. The title is specific and accurate.

Full details: Description check

Explanation

The description is directly related to the changeset. It explains that the PHP ExApp proxy forwarded /heartbeat, /init and /enabled paths, and that the change now returns 404 for them. It describes the path normalization logic (percent-encoded ? and #, single decoding, case and slash handling) that the controller change implements, and it lists the tests added for refused and look-alike paths.

Full details: Docstring Coverage

Explanation

Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 6 functions across 2 files. (1 skipped: 1 unsupported.)

Resolution

Write docstrings for the functions missing them to satisfy the coverage threshold.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Warning

Some tools did not complete. Review the errors below.

🔧 PHPStan (2.3.0)

PHPStan reported 1 non-file analysis error(s); analysis is incomplete

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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
Commits

Reviewing files that changed from the base of the PR and between 4dbb25a and d2d4d59.

Files selected for processing: 4
  • CHANGELOG.md
  • lib/Controller/ExAppProxyController.php
  • tests/php/Controller/ExAppProxyControllerTest.php
  • tests/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.

Comment thread lib/Controller/ExAppProxyController.php Outdated
Signed-off-by: Oleksandr Piskun <oleksandr2088@icloud.com>
@oleksandr-nc
oleksandr-nc force-pushed the fix/proxy-internal-endpoints branch from d2d4d59 to b145bc3 Compare October 26, 2026 11:20
@oleksandr-nc
oleksandr-nc merged commit 2ac72e6 into main Oct 26, 2026
54 checks passed
@oleksandr-nc
oleksandr-nc deleted the fix/proxy-internal-endpoints branch October 26, 2026 12:13
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.

1 participant