Pickleworm

Pickleworm

Diaphania nitidalis

This tropical moth is mostly a problem in the Southeastern United States. The caterpillars (the worms) feed on all of the Cucurbits (but especially summer squash), eating the flowers and leaves and burrowing into the fruit.

This can be a serious and quite frustrating pest and most control recommendations you find involve insecticides. There are a few other strategies though. You might try planting summer squash as a trap crop to keep them from the cucumbers. You should also clean up after the crop to prevent them overwintering in debris. It is possible to protect individual fruit by bagging them in paper bags within 24 hours of pollination. 

Image: Clemson University - USDA Cooperative Extension Slide Series, Bugwood.org