Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug]: CSV Import can corrupt the database by saving invalid entries #1811

Closed
1 task done
Shazib opened this issue Oct 17, 2023 · 2 comments · Fixed by #2494
Closed
1 task done

[Bug]: CSV Import can corrupt the database by saving invalid entries #1811

Shazib opened this issue Oct 17, 2023 · 2 comments · Fixed by #2494
Labels
bug Something isn't working needs info We need more information from the OP before continuing transaction import Related to manually importing transactions

Comments

@Shazib
Copy link
Contributor

Shazib commented Oct 17, 2023

Verified issue does not already exist?

  • I have searched and found no existing issue

What happened?

Originally impacted a user on fly.io, discord support thread here

Importing a CSV with an invalid (huge?) number, corrupts the database, and makes actual fail to load subsequently.

Reproduce by importing the following as a CSV:

Post Date,Description,Category,Reference Number,Amount
7/22/2023,BACKERKIT.COM GLOOMHAV   PACIFIC GROVECA,Miscellaneous General Merchandise Stores,8271116503061807,-15.00

Result:
"Fatal Erro" app fails to load permanantly.

Notes:

The parsing logic strips out evertything that isn't a digit with regex and has its own implementation of safeNumber?

https://github.com/actualbudget/actual/blob/master/packages/loot-core/src/shared/util.ts#L327-L353

The CSV Parser should possibly also validate that each row has the same number of columns, as the CSV had comma's in the content body.

What error did you receive?

image

Where are you hosting Actual?

Fly.io

What browsers are you seeing the problem on?

Firefox

Operating System

Windows 11

@Shazib Shazib added the bug Something isn't working label Oct 17, 2023
@Shazib Shazib changed the title [Bug]: [Bug]: CSV Import can corrupt the database by saving invalid entries Oct 18, 2023
@joel-jeremy joel-jeremy added the transaction import Related to manually importing transactions label Jan 16, 2024
@MatissJanis
Copy link
Member

👋 I am no longer able to reproduce this. Can you please double check?

Thanks!

@MatissJanis MatissJanis added the needs info We need more information from the OP before continuing label Mar 21, 2024
@Shazib
Copy link
Contributor Author

Shazib commented Mar 23, 2024

Sorry i think my examples wrong or it changed

Post Date,Description,Category,Reference Number,Amount
7/22/2023,BACKERKIT.COM GLOOMHAV   PACIFIC GROVECA,Miscellaneous General Merchandise Stores,8271116503061807,8271116503061807

Try that, deffo fails in the same way

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs info We need more information from the OP before continuing transaction import Related to manually importing transactions
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants