password-exporter icon indicating copy to clipboard operation
password-exporter copied to clipboard

Corrupts passwords by inserting URI-encoded entities

Open iam-TJ opened this issue 11 years ago • 1 comments

Using the password exported to CSV from another device I found the account would report "Bad username or Password" when trying to log-in. Initially I thought I was mistyping the password repeatedly. Eventually, I checked back with Firefox's "Show Passwords" and found that the exported password contains an ampersand, which the exported string had URI-encoded to %26. I had been typing the literal "%26".

I can understand why URI-encoding would be used for the double-quote character since it is the text-delimiter in CSV string fields.

I don't think it's the best approach to export URI-encoded without some indicator that the string is URI-encoded. I'd suggested prefixing any field that requires URI-encoding with "uri-encoded:".

During export it is easy to determine if the field requires URI-encoding simply by doing a strchr() style search for the double-quote. All other characters should not be encoded.

iam-TJ avatar Jul 20 '13 18:07 iam-TJ

Per RFC 4180, escaping should only be done for quote (") characters, and not for %, <, >, or &. And escaping " is done by preceding it with another ". I.e. foo"bar should be written as "foo""bar".

Similarly, RFC 4180 says to use CRLF as line delimiter on all platforms.

https://tools.ietf.org/html/rfc4180

sicking avatar Jan 18 '17 09:01 sicking