It is possible that your employer withheld taxes for CT instead of MA. This will mean, they did not withhold any taxes for MA, so you will need to pay the taxes to MA.
In general, your home state will tax all in come from all sources. What you will do is you will file a nonresident return for the MA. When you file, you will fille out your nonresident states first. Then you will fill out your resident state, claiming a credit for taxes paid to the nonresident states on your home state return. You may or may not still end up owing money to your resident state depending on whether or not their tax rate is higher or lower than your nonresident state. If the non resident state had a higher tax rate than your resident state, your credit will be limited to the amount of tax you would have paid to your resident state. They will not give you a refund of the taxes you paid to the nonresident state.
In this case, you will likely have to make a payment to MA, then get a refund of some sort from CT. You should correct your withholdings with your employer so they are withholding for both MA and CT.