80

Take this revision and all earlier revisions of the question as an example. The user posted his API key publicly in the question.

Talking about this matter in general, what is the correct behaviour here?

  • Leaving the key open on the Internet may possibly impact his site/service or may be used to do harmful actions in the key-holder's name.

  • Editing the key out leaves it in the revision history (and was not possible for me in this case, as the edited question contained mostly code and was not accepted).

  • Asking the questioner to delete his question is entirely based on his understanding. If he thought about the implications of his post, he may have edited it out before he posted the code.

For now I have flagged the question as "other needs moderator attention". However, I am not sure if this is the correct way to handle it, as it would require the deletion of an otherwise acceptable question.

2

3 Answers 3

97

You editing the post to remove the sensitive information (e.g. Personally Identifiable Information (PII); security credentials like passwords and access tokens; etc.) and then raising a custom moderator flagging is the appropriate action here. The moderator handling your flag will adjust the content of the revisions prior to the edit where you removed the sensitive information to no longer have the sensitive information you removed. The overall process is called redaction. As the moderator handling your flag completes their proposed redaction of the sensitive information from each earlier revision, another moderator will then review and approve each redacted revision. An internal log is kept of these redactions to prevent abuse.

Because deleted posts are visible by users with the access to moderator tools privilege (i.e. with >10k reputation), moderators will perform redactions of sensitive information from deleted posts when such are flagged.

Overall, the redaction process looks like:

  1. You should:
    1. Edit the sensitive information out of the post. The OP may choose to delete the post at this time, as that will further limit the spread of the information until redacted. If you don't edit it out, it remains visible to everyone visiting the page, and your flag then relies on the moderator seeing all of the same sensitive information you do, which will probably happen, but isn't guaranteed.
    2. Raise an "in need of moderator attention" moderator flag and explain that redaction is needed, if you haven't edited it out, be very clear what you feel needs to be redacted.
  2. The moderator handling the flag will then
    1. Separately propose a change (i.e. "redaction") of the sensitive information from each revision prior to your edit. In general, this can be viewed as applying the edit removing the sensitive information to each revision to permanently change each revision.
    2. A different moderator will review the redaction of each revision of the post and approve the redaction of that revision.

Security information is compromised; OP needs to change it

Once the sensitive information has been posted it is public and should be treated as compromised. Posts on Stack Overflow are routinely archived and/or copied by various sites. There's nothing anyone can do to make that information private again. Redaction will limit the spread of the information, but any access keys (API keys, tokens, etc), security credentials (e.g. usernames, passwords, etc.), etc. should be treated as compromised. All such items which are security concerns should be invalidated and changed.

3
  • 8
    How to notify the user that he leaked his key? Is there an FAQ "What should I do after I leaked sensitive information on SO?" you could point him to?
    – Bergi
    Commented Jun 2, 2014 at 21:55
  • 5
    @Bergi The moderator could send a moderator message if they wanted to, other than that, your best bet is to wait until after the content has been removed to notify them, to avoid drawing attention to the sensitive information.
    – Servy
    Commented Jun 3, 2014 at 14:01
  • It can take some time for a flag to get handled, and it doesn't retract what's already been viewed (or cached). You should probably also edit it and leave a comment telling the user to invalidate their key or do whatever else needs to be done to minimise the damage of the exposure of the data (although such comments might draw more attention to the fact that there is sensitive data, so I'm not actually that sure about that - a mod message is probably better, but, again, this takes time). Commented Nov 12, 2018 at 16:27
35

You handled it the correct way, edit out the details and then use an "Other" flag explaining that the revision history contains sensitive details that should be removed.

When a moderator reviews the flag, we will request that a member of the community team remove the revision history from the question we will redact the revision. Starting in Feb 2016 moderators were given the ability to remove sensitive details from a post.

2
  • 31
    I wish moderators had a "flag for Community Manager" link for this. It happens all the time. Alternatively, I wish people would stop doing this.
    – Bill the Lizard Mod
    Commented Jun 2, 2014 at 18:17
  • 20
    "I wish people would quit doing stupid things" - paraphrased. Me too, buddy, me too. Commented Jun 3, 2014 at 17:39
10

Edit and flag.

  1. Edit and delete the question to remove the information.

    This is a temporary fix. Editing will short term resolve this, and deleting will remove it from the majority of public view.

  2. Use a custom moderator flag describing the situation.

    Even something like this works:

    There's some sensitive information here. Can the revision that contains it be redacted?

    For a few weeks now, moderators can now redact revisions on posts by themselves (with the approval of a second moderator), so this should hopefully be quicker.

Remember, even if you are not the original author of the question, follow the steps above. Deletion might not be possible, but be sure to edit and flag describing the situation.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .