As long as the work gets done...
Depending on the industry, it's definitely not fine.
I work in healthcare. If one of our employees was giving a foreign national access to our internal systems, that would be a Very Big Deal.
In practice, when you are a developer you get to know lot of infrastructure and even sometimes customer secrets from Facebook, Apple, Google, PayPal, etc.
This is because the tech people actually speak together, ask feedback and share information.
When a doctor doesn't know, he asks the other doctors for opinion.
There are even websites for that (StackOverflow, GitHub, etc).
It's fine. I trust my employees to use their best judgement when making such choices.
It doesn't mean these 3rd-party guys will get access to your systems.
Even the NSA asks for help, you can see them in the reverse-engineering forums, in MediaWiki conferences, etc.
Experienced developers are not teenagers and act rationally, they don't do 10 years of career to suddenly risk losing all their trust/friends and reputation, all that for 5-minute fame on Twitter for a leak that is likely non-strategic to the outsiders.
Her productivity skyrocketed at night however, and she generally had working code in the morning, which lead to rumors that her husband or someone in her home country was doing the work (would have been daytime over there). Nobody really complained. She wore a hijab and the company had just hired it’s first “diversity officer” so maybe that’s why. Thankfully they stopped using that vendor not long after. It's a story a friend told me a long time ago. I didn’t and couldn’t fact-check it.
The husband’s theory came from the fact she apparently mentioned her husband was also a software consultant.