afuna: Cat under a blanket. Text: "Cats are just little people with Fur and Fangs" (Default)
afuna ([personal profile] afuna) wrote in [site community profile] dw_dev2009-03-14 08:43 pm
Entry tags:

Replying to comments from the emailed notification

The form at the bottom of the comment notification email contains a comment-specific hash, which authorizes the person posting the form as the user the notification was sent to. This is useful for replying if you're not logged in, or if you're logged in to another account (multiple journals, etc). But it also means that if you forward the comment notification email to someone else, they can reply as you for that particular comment.

This came up in Bug 314, after noting that one fix to allow OpenID users to reply to comments from the email had the side effect of removing the existing behavior -- the person posting the comment would have to be currently logged into the same account as the one which received the emailed notification for the comment to be posted.

D says this is a good thing! And I kinda agree, because it's good to close up the security hole. But I'm torn because I also really like the convenience of the existing behavior.

So, throwing ideas out there for how we can handle it:

a.) make it clear that the authorization is tied to the comment form, and that forwarding the notification email with the form to someone else will allow them to reply as you to that comment. Do it on the form itself, either subtly (changing the "post" button to "post as $user"), or by adding some kind of text; document this behavior somewhere people can easily find it.

This is pretty easy to do, but may not be effective, and may cause worry to have warning text.

b.) close the hole by showing an error message if the account you're trying to comment as does not match the account you're logged into.

Also easy to do, but pretty drastic.

c.) close the hole by forcing you to authenticate as the commenting user if it does not match the account you're logged into (More details, from Sophie).

I like this idea because it's not as drastic as option (b), and it looks relatively simple to implement. But it could also get annoying to have to reauthenticate all the time, depending on how often you'd have to switch accounts this way.

d.) provide another way to reply, perhaps by replying to the email directly, instead of using a form. (More details, from me).

I'm in favor of this idea because it solves a few other problems -- means you can always reply from the notification if you have access to an email client but not a browser (phones, DW blocked, composing comment replies offline), or if you're using one of the clients which disallows POST requests (off the top of my head, Thunderbird won't allow this). Also means no need to switch logins in the browser.

But it's the most drastic change to implement, and I don't know how much additional load it would cause to set up something that can receive email, parse it in a timely fashion, and post the comment, plus the time we would need to spend to build something from scratch.

e.) Other ideas?

[personal profile] rho 2009-03-14 02:33 pm (UTC)(link)
I'd recommend very strongly against a). Users frequently don't read things. Doubly so if it's a part of the static text that's the same in every singe email. Relying on users reading and paying attention or security doesn't seem like a good idea.

Other than that, I've no particular opinion. I still have my comments sent in plain text like Cthulhu intended, so have no clue what desired behaviour would be.
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)

[personal profile] sophie 2009-03-14 02:53 pm (UTC)(link)
If we did D, we would need to still be able to pass data:

* Proof that the reply came from replying to the mail, not via a newly-forged email. Replying by email is convenient, but we have to make sure that nobody can forge an email as somebody else.

* The journal name, entry ID and comment ID being replied to.

* Anything else?

Ideas on passing that information:

* We could pass the information as a hash in the subject line. However, this breaks threading in applications that use the subject line for threading, which to my knowledge includes GMail. It also looks a bit ugly, and could trigger spam filters.

* We could pass the information via a specially-formulated Reply-To address which would be parseable to give the info needed. (Note: We should *not* use the From address as a generic Reply-To address as this will mean that users can't add an address to their spam whitelists. That's something that really peeves me about Second Life offline IM notifications.)

* Others?

About the methods used to authenticate the email:

* For security, we should never just have the credentials as a single, standalone hash; this can be copied and used in forged emails very easily. This means that if credential hashing is used, we should *also* hash it with other data, like the entry and comment IDs, which is how it's currently done in the ECP hash. (I would suggest adding journal name to that hash too.)

* We could also use one-time hashes that are randomly generated by LJ for each email. However, doing this would mean both that the user would not be able to reply to the same comment twice from the same email, and also that we would need to expire the hash after a period of time - say, six months. The expirataion thing probably wouldn't be a problem, but I can see the first bit being annoying.

* There is little point in combining both methods, as the problems in the second point would still arise, and there will be no way to interactively ask for a username/password to confirm.

Random other comments:

* We will need to strip signatures and quoted text from the email. The DW code already strips signatures as part of the email posting mechanism, but I don't think it strips quoted text.

* We need to be able to have the capability to parse quoted-printable and/or HTML in case someone replies using that format. (this capability is probably already in email posting)

* Email programs tend to wrap emails to 78 characters a line. In the case where someone replied in plain text (not quoted-printable format or HTML), should we try to reconstruct the original lines or just leave the lines wrapped? (this question is also probably already answered in email posting, too)

Is there anything I've missed here?

(I'm personally still a fan of option (c) in your post; I think re-authenticating is a small price to pay in this case.)
Edited 2009-03-14 14:57 (UTC)
denise: Image: Me, facing away from camera, on top of the Castel Sant'Angelo in Rome (Default)

[staff profile] denise 2009-03-14 07:02 pm (UTC)(link)
I am a fan of option C, as the least annoying method.
highlander_ii: Chris Pine kneeling on the floor holding a camera to his face (Default)

[personal profile] highlander_ii 2009-03-14 11:34 pm (UTC)(link)
I will mention that a lot of people use 'reply by email' to avoid re-logging in to various accounts (if they have multiples).

Though, IIRC, friends-locked posts won't let one reply via email (but I'd have to double check that).
mark: A photo of Mark kneeling on top of the Taal Volcano in the Philippines. It was a long hike. (Default)

[staff profile] mark 2009-03-14 11:39 pm (UTC)(link)
because it's good to close up the security hole.

It is not a security hole because this feature is entirely by design. Just because it doesn't do what someone expects doesn't mean it is a violation of security or otherwise "bad." Call a fish a fish, don't call it a shark.

a) won't work because users don't read.

d) how will this actually change anything? It's easy to spoof the "From" of an email unless you put some token in the email. And then you're right back where you started: someone forwards it, the receiver spoofs it, and we didn't solve anything.

I prefer B to C, but either would be fine. Except!

Why even bother? This "issue" has been in existence on LJ for years and years and years and ... well, years. And I'm sure it's generated a complaint from time to time, but really? You don't forward emails to your enemies. When you forward a comment mail to a friend, they're not going to do Evil Things In Your Name! (And the only evil they can do is make a comment.)

If you DO forward it to someone who you don't want to have it, then - oh well! You can deal with the fallout from having them say something bad in your name. And then you tell the person they replied to that you're sorry and the problem is solved without spending a ton of development time reimplementing this. :)
aveleh: Close up picture of a vibrantly coloured lime (Default)

[personal profile] aveleh 2009-03-15 07:51 am (UTC)(link)
I'd love to do (b)/(c) plus (d) in the following way:

Default is to force users to authenticate, because it's expected and safe behaviour.
There's an option in account settings that you can select that basically says "send me insecure emails that I can reply in/to; and I understand that if I forward them, someone else can reply as if they're me".

Then I can use my phone to reply to emails, without firing up my browser.
sophie: A cartoon-like representation of a girl standing on a hill, with brown hair, blue eyes, a flowery top, and blue skirt. ☀ (Default)

[personal profile] sophie 2009-03-15 01:05 pm (UTC)(link)
If you forward a comment email to a friend, I would say it's likely that it was forwarded because said friend would have an opinion on it and they might decide that they want to comment on it themselves, and use the form to do so. It's not that they're being evil.
domtheknight: espresso machine brewing into little white mugs (Default)

[personal profile] domtheknight 2009-03-15 10:10 pm (UTC)(link)
afaik you can do it with locked posts but if you aren't logged in the post doesn't load properly. At least, that's been my personal experience (but it may have been awhile ago so I don't know if that's changed.)
zvi: self-portrait: short, fat, black dyke in bunny slippers (Default)

[personal profile] zvi 2009-03-15 11:37 pm (UTC)(link)
I think that the solution should (1) get you to the reply-to for the comment you got an e-mail about and (2) capture the text you attempted to submit, so I prefer (c), since if you make (b) do both of those things it might as well be (c).
janinedog: (Default)

[personal profile] janinedog 2009-03-16 01:55 am (UTC)(link)
I'm in favor of either keeping the behavior as it is (honestly, I can't think of anyone ever complaining about it on LJ) or option C.

tgbgqk

(Anonymous) 2009-04-25 12:43 am (UTC)(link)
o6F2xi qsjoydvpjbsi (http://qsjoydvpjbsi.com/), [url=http://bfmvadwakjik.com/]bfmvadwakjik[/url], [link=http://jarmbxdimcua.com/]jarmbxdimcua[/link], http://qjavmxlkojlv.com/

plRLlHHSigMqGIOge

(Anonymous) 2009-04-25 08:34 am (UTC)(link)
u0xFLN sqwklcgltzxl (http://sqwklcgltzxl.com/), [url=http://lrvhiqbgtjqp.com/]lrvhiqbgtjqp[/url], [link=http://osrnabckdcqp.com/]osrnabckdcqp[/link], http://idisgolwyaup.com/

uLMUsKdeHdbaVBxyK

(Anonymous) 2009-04-26 12:22 am (UTC)(link)
QMKJvy eqmuvbdfwxes (http://eqmuvbdfwxes.com/), [url=http://eeltxowogtzm.com/]eeltxowogtzm[/url], [link=http://neujuqfphulo.com/]neujuqfphulo[/link], http://zjnbunpddchn.com/