Skip to content

fix(Request): Catch exceptions in isTrustedProxy - #42794

Merged
susnux merged 1 commit into
masterfrom
fix/invalid-trusted-proxies
Jan 29, 2024
Merged

fix(Request): Catch exceptions in isTrustedProxy#42794
susnux merged 1 commit into
masterfrom
fix/invalid-trusted-proxies

Conversation

@susnux

@susnuxsusnux commented Jan 15, 2024

Copy link
Copy Markdown
Contributor

Summary

The function fails if the configured trusted proxies contain invalid characters and the underlying IpUtils will throw. But as it is used by getRemoteAddress which is used by logging / templating, thrown errors are not reported but silently fail with error 500.

Checklist

@susnuxsusnux added bug 3. to review Waiting for reviews php Pull requests that update Php code labels Jan 15, 2024
@susnuxsusnux added this to the Nextcloud 29 milestone Jan 15, 2024
@susnux
susnux requested review from a team, ArtificialOwl, blizzz, icewind1991 and nickvergessen and removed request for a teamJanuary 15, 2024 12:21
@susnux

Copy link
Copy Markdown
ContributorAuthor

/skjnldsv-backport to stable28

@susnux

Copy link
Copy Markdown
ContributorAuthor

/skjnldsv-backport to stable27

Comment threadlib/private/AppFramework/Http/Request.php Outdated
The function fails if the configured trusted proxies contain invalid characters and the underlying IpUtils will throw.
But as it is used by `getRemoteAddress` which is used by logging / templating, thrown errors are not reported but silently fail with error 500.
Co-authored-by: Ferdinand Thiessen <opensource@fthiessen.de>
Co-authored-by: Joas Schilling <213943+nickvergessen@users.noreply.github.com>
Signed-off-by: Ferdinand Thiessen <opensource@fthiessen.de>
@susnux
susnuxforce-pushed the fix/invalid-trusted-proxies branch from 1401506 to 7620d23CompareJanuary 27, 2024 14:00
@susnuxsusnux self-assigned this Jan 27, 2024
@susnux
susnux merged commit 8597859 into masterJan 29, 2024
@susnux
susnux deleted the fix/invalid-trusted-proxies branch January 29, 2024 15:19
@susnux

Copy link
Copy Markdown
ContributorAuthor

/backport to stable28

@susnux

Copy link
Copy Markdown
ContributorAuthor

/backport to stable27

Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

3. to reviewWaiting for reviewsbugphpPull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Upgraded from 24.0.11 to 25.0.5 then 25.0.6 but site is 500'ing

3 participants

@susnux@nickvergessen@artonge