You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is not possible to add a new user due to certificate error: X.509 Certificate cannot be retrieved in [/var/www/MISP/app/Model/User.php, line 431]
But if the SMIME.enabled option is set to 'true' then no error occurs and the user is created.
Expected behavior
That it is possible to create a new user without enabling the SMIME option.
Steps to reproduce
At "Server Settings & Maintenance" /servers/serverSettings/Encryption > SMIME.enabled: false
Then "Add user" /admin/users/add > set the email, the organization, the role and the PGP key; then press "Create user"
It will reply with "The user could not be saved. Please, try again." error.
Version
2.5.3
Operating System
Ubuntu
Operating System version
24.04
PHP version
8.3.6
Browser
Firefox
Browser version
133.0.3
Relevant log output
:~# tail -f /var/www/MISP/app/tmp/logs/error.log
2024-12-16 20:13:37 Warning: Warning (2): openssl_x509_read(): X.509 Certificate cannot be retrieved in [/var/www/MISP/app/Model/User.php, line 431]
Trace:
ErrorHandler::handleError() - APP/Lib/cakephp/lib/Cake/Error/ErrorHandler.php, line 232
openssl_x509_read - [internal], line ??User::validateCertificate() - APP/Model/User.php, line 431
CakeValidationRule::process() - APP/Lib/cakephp/lib/Cake/Model/Validator/CakeValidationRule.php, line 275
CakeValidationSet::validate() - APP/Lib/cakephp/lib/Cake/Model/Validator/CakeValidationSet.php, line 135
ModelValidator::errors() - APP/Lib/cakephp/lib/Cake/Model/ModelValidator.php, line 269
ModelValidator::validates() - APP/Lib/cakephp/lib/Cake/Model/ModelValidator.php, line 100
Model::validates() - APP/Lib/cakephp/lib/Cake/Model/Model.php, line 3503
Model::_doSave() - APP/Lib/cakephp/lib/Cake/Model/Model.php, line 1839
Model::save() - APP/Lib/cakephp/lib/Cake/Model/Model.php, line 1761
UsersController::admin_add() - APP/Controller/UsersController.php, line 779
ReflectionMethod::invokeArgs() - [internal], line ??Controller::invokeAction() - APP/Lib/cakephp/lib/Cake/Controller/Controller.php, line 500
Dispatcher::_invoke() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 193
Dispatcher::dispatch() - APP/Lib/cakephp/lib/Cake/Routing/Dispatcher.php, line 167
[main] - APP/webroot/index.php, line 107
Extra attachments
No response
Code of Conduct
I agree to follow this project's Code of Conduct
The text was updated successfully, but these errors were encountered:
I can't seem to be able to reproduce this. I have the setting set to false and it works correctly for me, from the validation function that you are getting the exception on, it is pre-pended by this check:
if (empty($check['certif_public'])) {
return true;
}
So if the field is empty (which should be the case if the setting is disabled, you won't even have that field in the form) the check should pass.
For more context: I did a fresh MISP installation in a new VM following the scripts INSTALL.ubuntu2404.sh
I did not change config files, and these are the lines that are causing the issue, at /var/www/MISP/app/Model/User.php
public function validateCertificate($check)
{
// LATER first remove the old certif_public from the keychain
// empty value
if (empty($check['certif_public'])) {
return true;
}
// certif_public is entered
// Check if $check is a x509 certificate
if (openssl_x509_read($check['certif_public'])) {
return $this->testSmimeCertificate($check['certif_public']);
} else {
return false;
}
}
If I comment all of them and I set SMIME.enable to false I can add the user.
Actual behavior
It is not possible to add a new user due to certificate error:
X.509 Certificate cannot be retrieved in [/var/www/MISP/app/Model/User.php, line 431]
But if the SMIME.enabled option is set to 'true' then no error occurs and the user is created.
Expected behavior
That it is possible to create a new user without enabling the SMIME option.
Steps to reproduce
At "Server Settings & Maintenance" /servers/serverSettings/Encryption > SMIME.enabled: false
Then "Add user" /admin/users/add > set the email, the organization, the role and the PGP key; then press "Create user"
It will reply with "The user could not be saved. Please, try again." error.
Version
2.5.3
Operating System
Ubuntu
Operating System version
24.04
PHP version
8.3.6
Browser
Firefox
Browser version
133.0.3
Relevant log output
Extra attachments
No response
Code of Conduct
The text was updated successfully, but these errors were encountered: