greenpau / caddy-security

🔐 Authentication, Authorization, and Accounting (AAA) App and Plugin for Caddy v2. 💎 Implements Form-Based, Basic, Local, LDAP, OpenID Connect, OAuth 2.0 (Github, Google, Facebook, Okta, etc.), SAML Authentication. MFA/2FA with App Authenticators and Yubico. 💎 Authorization with JWT/PASETO tokens. 🔐
https://authcrunch.com/
Apache License 2.0
1.37k stars 70 forks source link

ReadFileBytes panics when a provided path is empty #275

Open ahpaleus opened 11 months ago

ahpaleus commented 11 months ago

When the ReadFileBytes function is called with an empty string as the file path (ReadFileBytes("")), it leads to panic because the subsequent call to the expandHomePath function checks if the first character is a tilde. While this issue might not immediately expose a vulnerability, it could cause disruptions in certain scenarios.

To mitigate this, it is recommended to:

polarathene commented 1 month ago

While this issue might not immediately expose a vulnerability, it could cause disruptions in certain scenarios.

Could you please elaborate with a pragmatic example?