pydio / pydio-core

Pydio 8 official repository
https://pydio.com
GNU Affero General Public License v3.0
867 stars 289 forks source link

Suggestion to improve sanitization process for user id #1305

Open butaman opened 7 years ago

butaman commented 7 years ago

When user id consists of Japanese character (for example “てすと”), meta.git makes commit with system default author (not user id) and wrong message like “–author= mail@mail.com”.

I guess that some sanitizing process make variable $userid empty at meta.git as a result. In 6.x, author is properly set in commit log made by meta.git in any case. However, in 7.x, commit log made by meta.git is broken if user id consists of invalid chars for SANITIZE_EMAILCHARS.

I think any chars in userid should not be replaced by empty string at input process, and special chars should be escaped at output process.

for example,

If sanitizing input is mandatory for security reason, I suggest to validate input instead of sanitizing. User id should be validated at getting result of listUsersPaginated() of AuthDriver, and users contains invalid chars in his user id should not be listed up. Sanitized user id may causes unexpected problems.

By the way, according to RFC6531, SMTPUTF8 permits international chars (above U+007F) encoded in UTF-8. I suggest to make SANITIZE_EMAILCHARS to permit international chars.

Note: This issue is from https://pydio.com/forum/f/topic/after-upgrade-to-pydio-6-2-2-unable-to-login-if-user-id-includes-slash/