ericberman / MyFlightbookWeb

The website and service for MyFlightbook
49 stars 18 forks source link

Capitalization is getting changed on some flights, causing unauthorized access #1291

Open ericberman opened 2 months ago

ericberman commented 2 months ago

If a user is abcdef, some flights are sometimes abcdef and some are Abcdef. These fail the authorization check when you go to edit them. Need to relax that check to be case insensitive, but the bigger question is "why is the capitalization getting changed???"

ericberman commented 2 months ago

Interesting -

select f.username, f.username, u.username from flights f inner join users u on f.username=u.username where binary f.username <> u.username

reveals 232 such flights, across 8 users.

ericberman commented 2 months ago

Still should fix the flights. The query here is select idflight, f.username, f.username, u.username from flights f inner join users u on f.username=u.username where binary f.username <> u.username

ericberman commented 2 months ago

Got a report of this happening with saving a pending flight from the iOS (look for Resources.WebService.errFlightNotYours), but I'm not doing any case-sensitive username comparison there. I am doing one on the pending flight ID, though.