r/talesfromtechsupport • u/punxsutawneyphyllis Shadow Error: Six more weeks of winter added. • Jun 04 '18
Medium We don't know where this script is coming from!
This happened over the course of the past week, and finally ended today.
The Characters:
$Me: The only programmer at the company
$Supe: My somewhat tech-savvy supervisor
$AdGuy: A PPC ad guy, who also does SEO and other analytics-related stuff. For those who remember my previous story, yes, this is $NewGuy.
One week ago, $Supe approaches me.
$Supe: Hi, you're going to hate me for this.
$Me: Okayyyy, what's up?
$Supe: We have an analytics script on CompanySite that we can't find the source of. We used to add this script via TagManager, but that was giving us duplicate stats. We know the script is working, because we're still receiving the stats. We had an outside guy try to find this a while back, but he couldn't find anything. $AdGuy needs to make sure that this script only sends anonymized IP data, to be compliant with GDPR, so this is very important.
$Me: Do you have any other information?
$Supe: Nope.
So I proceed to grep the entire server for this script. I cant find it or any reference to it, except in cached pages. I go back to $Supe.
$Me: So the script isn't on the server. This most likely means that it's being inserted by an outside service. Can you think of any service that you might have set up that you're not using anymore?
$Supe: Nope.
Great. So the next day, I visit every analytics and code insertion service that I know the company uses, and check each one. Nothing. Then I try MetalBrowser's tools, and discover that the pageview request URL created by this script already contains a directive to anonymize the IP address. Awesome, right? I relay this information to $Supe, but he tells me to keep looking because he still doesn't want scripts with unknown sources running on CompanySite.
I proceed to bang my head on this for a couple more days. Then I hit on the idea of loading CompanySite incrementally, so I can see when this script appears, and hopefully what adds it.
Today, I load the page incrementally. The analytics script has already appeared at the first breakpoint. There's only one other script loaded, something with a gibberish file name. I open it up in the sources tab, and it says...CumulusFire? The load balancer? Why would that insert an analytics script? I open up the company's CumulusFire account, and see a link to something called "Apps". And there's an analytics app installed. I uninstall it, and reactivate the script in TagManager. Five minutes later, $Supe arrives in the office.
$Me: I found the source of the script, apparently someone installed it via CumulusFire.
$Supe: Oh, right, I forgot we'd done that!
$Me: facepalm
42
u/AutisticTechie Ping 127.0.0.1 - Request Timed Out Jun 04 '18
was the data the script was sending all anonymized correctly?
4
u/FiveYearsAgoOnReddit Jun 05 '18
I'm confused. How can you have a script on your site, and be receiving data from it, but it's a script you don't know about?
451
u/Myte342 Jun 04 '18
This is why i over document on EVERYTHING. People know me well enough now that when they ask me a question on something I handled and I say "Hold on let me check the records" that 99% of the time I will have ten times more info than they think they need documented on the subject.
298
u/reverendjesus I Am Not Good With Computer Jun 04 '18
“Put it back”
132
u/EurekaFlag Jun 04 '18
...& that's when & why I beat him to death with my Keyboard, Judge!
24
u/dvdmuckle Jun 04 '18
"The script is coming from inside the building!"
14
u/gluggerwastaken Jun 04 '18
What's CumulusFire?
11
u/SarahC Jun 04 '18 edited Jun 04 '18
That's why all my OOP multi file VBScripts output the computer name, and path of where they were running from as part of their email reports.
Saved hours of hunting! If you're ever coding a script that emails - put that info at the bottom in a small font (by using WMI and such, not hard coded).
9
u/silvermistshadow I'm sorry, are you from the past? Jun 04 '18
I was expecting it to end with 'the script came from the 192.168/16 block!'. I am both disappointed and amused.
3
u/AshleyJSheridan Jun 06 '18
This is why I always advocate against anything that can be used to just inject code into any website. Had nothing but problems come from things like this. If it's code going into a production website, it needs to follow the same processes as everything else and that means being in a repo, part of continuous integration, and properly tested.
2
u/evasive2010 User Error. (A)bort,(R)etry,(G)et hammer,(S)et User on fire... Jul 02 '18
his face, your palm?