this is not just about you and your risk, but also about the risk for the project.
As far as I'm aware these legal dark corners are uninhabited. If you say:
> I was blocked, so I fixed a bug, and rather than wasting time maintaining an internal fork in violation of the OSS project's license, I complied with that license by contributing my fix upstream.
I've never met a manager or a maintainer who would suggest that you open the can of worms by contacting a lawyer about it. We all know that intellectual property is a bit of a farce, especially as applied to software that was written jointly by an employee and model that was likely trained on the OSS project in the first place. But it's not a problem unless it's a Problem, so as long as no party is injured, why make it one?only the maintenance argument holds, but that is a trade-off, not a legal requirement.
A clause like this might be unenforceable, but if you know anything about US employment contracts, you'll know: Companies will write EVERYTHING in these things. They don't give a shit. They don't care if its unenforceable. If it were socially agreeable they'd write in a clause forcing you to give up your first born child to the corporation, and then you'd say "Uh, no, you have no right to require that" and they'd say "Oh right yeah ok that's fine" and that's it. That is how employment contracts LITERALLY work. They just vibe write shit in them, because they can. Meanwhile employees treat them like like live ammo in a loaded gun the corporation is holding to their head.
Nine times out of ten if anything in an employment contract is going to be used against you, its going to be used to fire you, and that's where it ends. In that remaining 10%, its cases like "intentional corporate or international espionage where tens millions of dollars were lost to a competitor" It is actually fucking hilarious that you think anyone would want to spend the bajillions of dollars it costs to send lawyers into court because a little software engineer contributed some code to kubernetes at 4pm instead of 6pm. Bro: You're not that important. No one cares about you. Contribute the code.
There are actually literally zero instances of companies enforcing a "we own all the code you write" clause against contributions to an open source project.
the thread is about contributing to a project on company time in order to submit a change that the company needed. the fact that this work is owned by the company is not in dispute. it is 100% certain that the company owns that work because it was done in order to solve a company problem, and you most certainly got paid for it.
so the problem is not one of a company enforcing an "we own all the code you write" clause but the fact that as an employee you do not have the right to publish work the company owns, unless they give explicit permission. google for example does give explicit permission and does limit contributions to projects that have specific licenses. for example googlers are not allowed to contribute to AGPL projects.
as a project owner, i need the assurance that you do have permission from your employer. the fact that no employer has ever enforced ownership is irrelevant to me. if it is clear that you wrote that patch at work, i want to see your permission.