Comments (2)
No it's not. DB encoding shouldn't be relied on for a security control, you should always sanitize input on receipt (from any data source eg user input), db read and write etc.
This lib uses PDO which has some protection against common sql vulnerabilities, but there are several other ways your code can be vulnerable. Have a look at my other posts for an example, such as JavaScript into the DB.
Note, I don't speak for the project
from php-auth.
Thanks for your question!
Yes, there may be security implications when using the broken utf8
instead of the proper utf8mb4
, but I'm currently not aware of any. That being said, if you follow the README and do what the examples suggest, you should be safe using utf8
.
For utf8mb4
support, you only need MySQL 5.5.3+ or a recent MariaDB version, which have been available for quite some time now (several years). As a recommendation, I would thus say you should upgrade your database engine's version, which you ultimately have to do at some point, anyway.
One thing that you will definitely experience is data loss. If non-BMP characters are used in usernames, email addresses or other strings passed to this library, it depends on MySQL's settings what happens. If MySQL is in "strict mode", it should throw an error. Otherwise, MySQL will probably accept the input and fail silently, simply truncating everything starting with the first non-BMP character. So foo💩bar
might become just foo
.
If we have learned anything from the past, especially from problems with null bytes, it's that silent data truncation is often dangerous.
For international products on global markets, with support for the non-English world, including any minor languages, probably also for emoji support, utf8mb4
is a must!
Apart from data loss, the only implication for security that I could imagine right now is truncated email addresses that cause unexpected behavior. Something like
[email protected]💩.evil.example.com
becoming
in the database while the verification email goes to the evil.example.com
host. You would have to check the specifications for the local part and domain part of email addresses to check what's really possible here.
That should, however, be prevented by the internal syntax checks for email addresses, which are performed automatically. The effectiveness of those checks will depend on the behavior of PHP's \filter_var
function with the \FILTER_VALIDATE_EMAIL
flag, though, which might change in future versions.
Hope that helps!
from php-auth.
Related Issues (20)
- Normalize users table to reference email addresses in another table? HOT 3
- User "verified" status does not change HOT 4
- How to attach to already started session? HOT 3
- How to avoid resendConfirmationForEmail if user is already verified? HOT 1
- How do I remember the user after calling admin()->logInAsUserById? HOT 1
- Compatibility with Redis for User Sessions
- Random User Logout and Cookie Anomalies HOT 4
- $auth->forgotPassword creates fatal error HOT 2
- Use PHPAuth for a REST API ? HOT 1
- InvalidSelectorTokenPairException on every attempt to change password HOT 7
- periods in email addresses HOT 2
- Is compatible with php 8.1 ? HOT 2
- [php 8.2.4] - Deprecated: Automatic conversion of false to array is deprecated / multi-projects
- oAuth2 + PHP-auth implementation HOT 1
- The best way to send a re-confirmation email? HOT 5
- Encryption of PII HOT 1
- More documentation is required
- session is empty after redirect HOT 7
- Why use selector/token pair for password reset? HOT 1
- [Question] Logout everywhere after password reset. HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from php-auth.