nilsteampassnet / TeamPass

Collaborative Passwords Manager
https://www.teampass.net
1.67k stars 546 forks source link

Unable to view custom field's content after upgrade #3945

Open yong-sheng-03 opened 11 months ago

yong-sheng-03 commented 11 months ago
### Steps to reproduce 1. Upgrade Teampass from 3.0.10.46 to 3.0.10.135 2. Open any password item that previously had custom fields filled in 3. ### Expected behaviour The custom fields should be filled in with information (as per before the upgrade) ### Actual behaviour The custom fields are empty (except custom fields which data are encrypted in the database) ### Server configuration **Operating system**: Ubuntu 20.04.6 LTS **Web server:** 8.0.34-0ubuntu0.20.04.1 **Database:** MySQL **PHP version:** 8.2.11 **Teampass version:** 3.0.10.135 **Teampass configuration file:** [tp.config.php.txt](https://github.com/nilsteampassnet/TeamPass/files/13362375/tp.config.php.txt) **Updated from an older Teampass or fresh install:** Updated PLEASE attach to this issue the file `/includes/config/tp.config.php`. ### Client configuration **Browser:** Chrome **Operating system:** Windows 10 ### Logs #### Web server error log ``` No error log ``` #### Log from the web-browser developer console (CTRL + SHIFT + i) ``` No error log ```
yong-sheng-03 commented 11 months ago

~When logged in as admin, I am also unable to load the users in Users page.~

~Log from the web-browser developer console (CTRL + SHIFT + i)~ ~teampass_users_error.log~

Update: I corrected the teampass URL in the settings and the Users page is loading properly.

WebxDES commented 11 months ago

I just performed a fresh install and im unable to load any of the tabs other than "Options" and there is multiple UI sections that are missing now.

image

nilsteampassnet commented 11 months ago

@yong-sheng-03 Thank you for reporting. I have fixed the issue.

@WebxDES It seems the issue is related to client. Please, clear the browser cache (CTRL+F5), and check the files consistency on the server

sithius82 commented 11 months ago

Hello @nilsteampassnet Made a fresh install 1 hour ago. The same issue appeared. Browsers: Firefox, Chrome, LibreWolf. All of them in the normal mode and incognito. The same issue remains. Also there is no possibility to turn off maintenance mode because of this issue. The only way to leave the stuck page (refresh is not helping) - to go to link in the upper left corner with Teampass logo The only problem page is Options. Other pages working well. Install time (git clone) is 14:20 (GMT+3) tp_install_3

nilsteampassnet commented 11 months ago

@sithius82 Please provide all possible logs

nilsteampassnet commented 11 months ago

@sithius82 I could finaly reproduce ... working on it

nilsteampassnet commented 11 months ago

@sithius82 Fix has been committed

sithius82 commented 11 months ago

Thanks a lot! Confirming it works fine now.

yong-sheng-03 commented 11 months ago

@nilsteampassnet I have tried the latest commit (3.0.10.150). The custom fields are not empty anymore, but the content is not correct as seen in the picture below.

image

Additionally, when I generate a new OTP for a test user to troubleshoot, the custom fields then become empty again.

There are no errors in apache log and browser console log.

Your help is very much appreciated.

nilsteampassnet commented 11 months ago

@yong-sheng-03 I did a small adaptation in latest commit Please check

Regarding

Additionally, when I generate a new OTP for a test user to troubleshoot, the custom fields then become empty again

How do you perform this? As an admin, you generate a new OTP from the users list, or do you generate new keys when logged as the user itself?

yong-sheng-03 commented 11 months ago

@nilsteampassnet

I've just tried with the latest commit.

Whenever I open an item with custom field with content, the following error is shown. image

Web Console Error: error_web_console.log Apache Error Log: nothing

As for this,

How do you perform this?

I generated a new OTP from the users list as an admin. As in the last commit, I was unable to generate new keys when logged as the user itself (the button would not function after I clicked confirm).

However, I will try to do that in the latest commit and report back with the results.

nilsteampassnet commented 11 months ago

@yong-sheng-03 I really don't understand why you get this error. The field data seems to be base64 encoded so I just added a base64_decode if indeed the data is base64 encoded. Can you tell me if the fields were previously defined as encrypted in the database?

yong-sheng-03 commented 11 months ago

@nilsteampassnet

Sorry if you have seen my deleted comment previously. I had made a mistake and was not looking at the right thing.

Can you tell me if the fields were previously defined as encrypted in the database?

No, it was just created as normal text fields using the TeamPass custom fields function.

nilsteampassnet commented 11 months ago

@yong-sheng-03 Ok so you mean that the latest commit permitted to see the fields value?

yong-sheng-03 commented 11 months ago

@nilsteampassnet Sorry for the confusion but no I am still unable to view the fields value. When clicking into the items with custom fields, the error is still showing. image

I've tried generating new keys when logged in as the user itself but I am still getting the same error as above.

As its past office hours where I am, I would not be able to reply to you until next week but I'll try and get back to you with anything as soon as possible.

Thanks alot for the help.

nilsteampassnet commented 11 months ago

@yong-sheng-03 Ok no problem Can you just do one thing for testing purpose, and espacially check if the strings you see are base64 encoded. Please, do the next:

also are the value in Chinese characters?

yong-sheng-03 commented 11 months ago

@nilsteampassnet

I've done all the steps above and the result do NOT return a valid value.

also are the value in Chinese characters?

No, all the characters inserted were English only.

nilsteampassnet commented 11 months ago

@yong-sheng-03 How strange, I don't understand the whole logic. Would it be possible next week to have a screensharing session ?

yong-sheng-03 commented 11 months ago

@nilsteampassnet

Apologies for the late response.

I've been looking at the teampass database, and I've noticed something.

The current latest commit of Teampass seems to be loading the custom fields content for an item from the "teampass_categories_items" table of the database (which has the weird encrypted looking data).

However, in the "teampass_defuse_passwords" table of the database, it has all the unencryped content of the custom field.

Is it possible that Teampass is getting the data to put in the custom fields from the wrong table?

Anyways, if you still need more information, a screen sharing session can definitely be arranged.

Thanks.