Skip to content

prevent HTTP request to internal networks by user content - #2228

Merged
blued-gear merged 6 commits into
mainfrom
fix/prevent_malicious_lan_requests
Sep 23, 2026
Merged

blued-gear merged 6 commits into
mainfrom
fix/prevent_malicious_lan_requests

Conversation

@blued-gear

Copy link
Copy Markdown
Collaborator

Introduce new HttpClient factory which produces a client that blocks requests to internal and localhost networks using Symfonys NoPrivateNetworkHttpClient decorator.
All HttpClients in the project were replaced with instances produced by this factory.

fixes GHSA-779p-4f7q-pg32
supersedes #2225

Comment thread src/Controller/AjaxController.php Outdated
Comment thread src/Factory/WwwHttpClientFactory.php
@blued-gear blued-gear added backend Backend related issues and pull requests security Issues and pull requests that address security concerns labels Sep 21, 2026
melroy89
melroy89 previously approved these changes Sep 22, 2026
@melroy89

Copy link
Copy Markdown
Member

Maybe just two small minor nits..:

  1. Transitive dependency used directly, UrlUtils::checkUrlSubpathNotAscending() uses GuzzleHttp\Psr7\Uri/UriResolver, but guzzlehttp/psr7 isn't in composer.json. It's only present transitively via embed/embed. It works today, but a future dependency swap could break it. Consider adding "guzzlehttp/psr7": "^2.x" to require explicitly, agreed? Or do not depend on it ;P
  2. Test base class, UrlUtilsTest extends WebTestCase (boots the full kernel) but only calls static methods with no container access needed. EmbedTest in the same directory extends plain PHPUnit\Framework\TestCase -> matching that would make it a true unit test and faster to run.

@blued-gear
blued-gear requested a review from melroy89 September 22, 2026 22:06
@blued-gear
blued-gear enabled auto-merge (squash) September 23, 2026 19:58
@blued-gear
blued-gear merged commit 565a8db into main Sep 23, 2026
9 checks passed
@blued-gear
blued-gear deleted the fix/prevent_malicious_lan_requests branch September 23, 2026 20:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

backend Backend related issues and pull requests security Issues and pull requests that address security concerns

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants