Database structure outdated, weak error handling #12

Open
opened 2024-03-03 08:53:34 +01:00 by pfm · 3 comments
Owner

Upon unsuccessful key upload I've got:

Encountered database error: SQLSTATE[HY000]: General error: 1364 Field 'status' doesn't have a default value. If this is unexpected, consider reporting it to our web team. Otherwise, click here to return to the home page.

with:

  • "reporting it to our team" linking to Support Mailbox,
  • "click here to return to the home page" linking to https://keys.lacre.io.

Most important thing here, is that we expose SQL error as-is and the user could try abusing it.

Upon unsuccessful key upload I've got: > Encountered database error: SQLSTATE[HY000]: General error: 1364 Field 'status' doesn't have a default value. If this is unexpected, consider reporting it to our web team. Otherwise, click here to return to the home page. with: * "reporting it to our team" linking to Support Mailbox, * "click here to return to the home page" linking to https://keys.lacre.io. Most important thing here, is that we **expose SQL error as-is** and the user could try abusing it.
Owner

Yes I saw that issue. I thought for now exposing errors is ok as we are in early stages and perhaps its good to see 'em. So we need to add default value in db schema right?

Yes I saw that issue. I thought for now exposing errors is ok as we are in early stages and perhaps its good to see 'em. So we need to add default value in db schema right?
Author
Owner

Yes, I've added it on lacre.io and next I'll add it to lacre.dbschema in the backend.

I would rather log these kinds of issues somewhere and just tell the user something went wrong.

Yes, I've added it on `lacre.io` and next I'll add it to `lacre.dbschema` in the backend. I would rather log these kinds of issues somewhere and just tell the user something went wrong.
Author
Owner

The column is set to default 0 now.

The column is set to `default 0` now.
Sign in to join this conversation.
No Label
No Milestone
No project
No Assignees
2 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: Lacre/lacre-webgate#12
No description provided.