mirror of
https://github.com/SuiteCRM/SuiteCRM.git
synced 2026-03-02 19:16:58 -05:00
Bug in url-encoding smtp Gmail password #3309
Labels
No labels
Area: API
Area: Campaigns
Area: Cases
Area: Clean Up
Area: Clean Up: Performance
Area: Dashlets
Area: Databases
Area: Developer Tools
Area: Elasticsearch
Area: Elasticsearch
Area: Emails
Area: Emails:Campaigns
Area: Emails:Cases
Area: Emails:Compose
Area: Emails:Config
Area: Emails:Templates
Area: Environment
Area: Installation
Area: Language
Area: Mobile
Area: Module
Area: PDFs
Area: PHP8
Area: Reports
Area: Studio
Area: Styling
Area: Upgrading
Area: Workflow
Area:Activity Stream
Area:Calls
Area:Import
Area:Projects
Area:Search
Area:Surveys
Area:Themes
Area:Users
Branch:Hotfix
Good First Issue
Hacktoberfest
Help Wanted
PR:Community Contribution
PR:Type:Enhancement
Priority:Critical
Priority:Important
Priority:Moderate
Severity: Major
Severity: Minor
Severity: Moderate
Status: Requires Code Review
Status: Requires Updates
Status: Stale
Status: Team Investigating
Status:Assessed
Status:Fix Proposed
Status:Needs Assessed
Status:Requires Automated Tests
Type: Bug
Type:Deprecated
Type:Discussion
Type:Duplicate
Type:Invalid
Type:Question
Type:Suggestion
Type:Suggestion
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/SuiteCRM-SuiteCRM#3309
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dsconsulting1234 on GitHub (Sep 19, 2018).
Issue
SuiteCRM incorrectly url-encodes "special" characters in (at least) the Gmail smtp password. Or, forgets to un-encode them, depending on how you look at it.
When setting up smtp integration via Administration -> Admin -> Email Settings, I entered the credentials for the Gmail account for SuiteCRM and noticed I received an auth failure.
I had to go into the PHP code and modify it to get the base64-encoded fields instead of just "--obfuscated--", and that's when I saw that a '>' character in the password I entered was being encoded as
>before being sent to Gmail's smtp server.When the password was changed to not have any "special" characters, everything started working, I could send a test message successfully.
Expected Behavior
When putting special characters into Gmail smtp passwords, it should send the password as-stated, and not a url-encoded/escaped version of it.
Actual Behavior
It sends the url-encoded/escaped version of the password, not the actual password.
Possible Fix
Either don't escape the password in the first place, or remember to unescape it before sending to the smtp server.
Steps to Reproduce
Create a gmail account with a '>' in the password.
Go to Administration -> Admin -> Email Settings
Set up Gmail smtp for SuiteCRM.
Edit the code in /bitnami/suitecrm/include/SugarPHPMailer.php in the app container like the following:
Open your browser debugger to capture the HTTP response.
Click "send test email" and enter a proper email address.
Click send.
Observe the now-base64-encoded bits in the debug output (before editing the code, it would have been
--obfuscated--.Decode those values doing the following, or the equivalent for the password field:
Note that the '>' that was entered for the password actually becomes
>.Context
This bug effectively breaks smtp integration in a really obscure way that was fairly difficult to debug.
The workaround is easy (change the password to something without "special" characters), but it's difficult for the user/admin to realize that's the proper workaround.
Your Environment
Chrome Version 68.0.3440.106 (Official Build) (64-bit)
@dsconsulting1234 commented on GitHub (Sep 19, 2018):
Looks like this issue has been around for about ~1 year at least:
https://suitecrm.com/suitecrm/forum/suitecrm-7-0-discussion/15748-smtp-connection-failed-error-in-suitecrm-7-9-4#54284
@benperiton commented on GitHub (Jan 31, 2019):
Also just encountered this on installing a fresh copy - the DB password contained '<' and ended being encoded to
<