I work for a large corporation and I want to keep my skills fresh. I think contributing to an open source project would help, especially if I ever want a job at a startup. I have heard that large companies often own any development employees do outside of work. Could I face legal consequences by contributing to an open source project without notifying my employer? Could I be putting an open source project at risk if I contributed to it while employed? If refrained from contributing due to legal reasons and I applied to another company where open source development experience is expected, would they understand or would my application go in the trash bin?
There are two real questions here. The first is what are you liable for. The second is whether you should be concerned. Those two have different answers.
I'll first answer the first to the best of my ability. I am not a lawyer, and this is not legal advice. If you are concerned, check your employment contract, and consult with a lawyer. But I can summarize the situation in two states.
In New York state, you are likely to be a professional employee. A professional employee has no set hours, and no set workplace. If you go out to dinner with a client, you're at work. If you figure out how to solve something in the shower, that belongs to your employer. As a professional employee the default, which is likely also in your contract, is that all of the software that you write is a work for hire that belongs to your employer. The prevalence of this kind of arrangement is one of the reasons that the FSF requires copyright assignment, and requires your employer to sign off on it.
In California the situation is different. As long as the software that you write does not relate to anything your employer is doing, anything done on your own time with your own equipment belongs to you, and this right cannot be signed away. However if you're independently developing the same thing that your employer is, it is probably going to be owned by your employer. Even if it was a secret project that you did not know about. Whether this case is important depends on the details of what you are working on, and what your employer is working on.
So you see that there is no simple answer. Depending on the state, and the facts of your situation, you might or might not own your own work. And if you don't own it, you have no right to license it.
Now on to the practical issue. What the law says determines what will happen should a dispute arise and be taken to a judge. However it is very uncommon in practice for disputes to arise and be taken to judges. Furthermore many employers either don't care, or positively like, their employee contributing to open source work. Particularly if the project is one that the company finds useful and they would like you to develop expertise with it. Frequently procedures exist to get OKs for you to perform such work. It doesn't hurt to check.
Furthermore if you contribute to open source work, despite the fact that it is unclear whether you have a right to do so, the odds are pretty good that you actually won't get in trouble for doing so. And if you do get into trouble, the odds are that you'll get a slap on the wrist and be told to take stuff down, rather than suffering large legal penalties. Is the remaining possible risk within your comfort zone? That is up to you. But I can tell you that there are a lot of people doing it, and fairly few stories of people running into trouble. (And in the stories that exist, usually there was some other cause of trouble, and the fallout for their open source work is a consequence.)
You'd have to look in your contract to see if it said anything about that, but if such a provision did exist, in many jurisdictions it could be safely ignored as unconscionable and unenforceable.
Standard disclaimer: I am not a lawyer, and this is not legal advice. Just common sense, which as we all know is frequently found to conflict with actual laws or court rulings, especially where software is involved.
Talk to the companies legal department. Any good employer of developers should understand and encourage it (they may even pay you for it (google's 20% time is an example) if the OS project is useful enough), but it's much better to be safe in this kind of situation.
If they say it's fine and that they won't take the code, get it in writing.
If they try to take the code later on you have your ass (and that of the project) covered...
The worst they can say is "no"
I understand your caution, but JUST GO AHEAD AND CONTRIBUTE.
It is very unlikely that anything is legally wrong with this even on paper, also unlikely that anyone at your job will even notice your contributions if you don't talk about it, and still most unlikely that you would be penalized in practice.
If it makes you more comfortable you can contribute through a handle rather than your full name.
Make sure you can legally contribute code to an open source project. This may be a matter of living in the right jurisdiction, having an employment contract that specifies you own what you create, or having specific permission from your employer (from somebody who has the authority to grant that, which may not be your manager).
Otherwise, the OS project is in danger. It may be hit with a lawsuit, and OS projects are usually not set up to defend. If your employer cares, the OS project is likely to be legally forced to remove your contribution, at which point you've definitely harmed the project. Other projects that used your code may also be at risk.
I'm not addressing the problems you may face. Those are your considerations, and you can decide for yourself is you want to risk being fired and possibly even sued. I'm addressing the problems you may cause to a project you're trying to help.