36

These questions are obviously off-topic, but that doesn't mean they do not get posted at a steady rate.

It would be helpful if there was a canonical reference (such as, oh, I suppose, this question? Provided I get good answers) explaining how

  • posting malicious code on Stack Overflow is not welcome
  • attempting to remove malware by hoping to find and revert all changes made by the intruder is misdirected and a fine example of the XY Problem
  • the only sane solution is to roll back to a clean check-out from version control or (if you don't have version control, and have not yet been fired or shot for that reason) known-good backups, of course only after you have identified and patched the intrusion vector

The search https://stackoverflow.com/search?q=hacked+site currently seems to bring up a high-precision sample of these questions; but to keep this question self-contained, I am linking a few here as examples.

6

1 Answer 1

8

Somewhat contrary to my expectations, there is no explicit policy against posting malware; though illegal content is (obviously) illegal (which means viruses and malware in many jurisdictions). Other than that, it's a "case by case" basis, though posting malware code thoughtlessly when the content of the malware is not of central interest to the question at hand is of course sloppy. A quick fix for that would be to edit the question to "disarm" the malware, while still leaving enough for the question to make sense.

References;

For the other two points in the question, my proposal would be to nominate new questions as duplicates of this old, well-focused question with general applicability and a reasonably succinct accepted answer, and not too much noise.

As pointed out in comments, there is an excellent canonical question on Server Fault, which I will also link to in a comment from the question above.

8
  • I requested a historical lock on the candidate canonical question but it has not been implemented. Is it not significant enough to serve as part of the canon? Is there another question which would be more suitable?
    – tripleee
    Commented Jan 5, 2016 at 10:02
  • 7
    Why would you want to lock the post, forever preventing anyone from ever editing it or voting on it?
    – Servy
    Commented Jan 5, 2016 at 15:39
  • It was a mistake; I had hoped to be able to get the "historical lock" banner, but that is appasrently only available to mods. Because it's off-topic, I don't think it needs to be voted on, so no big harm IMHO; but I'm not sure my reasoning is correct.
    – tripleee
    Commented Jan 5, 2016 at 16:11
  • Where in the linked questions or anywhere else do you read a consensus to break the post? Commented Jan 5, 2016 at 17:50
  • I have requested moderator intervention to undo the lock. There does not seem to be a way for myself to undo it.
    – tripleee
    Commented Jan 5, 2016 at 18:08
  • There's a difference between "Here's some malware I found hacked into my site" and "Here's some code, blah blah blah" where the code is malware and the question is a bait and switch.
    – user4639281
    Commented Jan 5, 2016 at 18:45
  • @TinyGiant I imagine you ase thinking of other types of questions, though? "I have dangerous code" is hardly a good set-up for bait and switch.
    – tripleee
    Commented Jan 5, 2016 at 21:06
  • That was what I meant. If the user is saying it is possibly dangerous then it isn't a very good bait and switch.
    – user4639281
    Commented Jan 5, 2016 at 21:15

You must log in to answer this question.

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