The squash vine borer (Melittia cucurbitae) is a diurnal species of sesiid moth. The moth is often mistaken for a bee or wasp because of its movements, and the bright orange hind leg scales. The females typically lay their eggs at the base of leaf stalks, and the caterpillars develop and feed inside the stalk, eventually killing the leaf. They soon migrate to the main stem, and with enough feeding damage to the stem, the entire plant may die.  For this reason, it is considered a pest that attacks cultivated varieties of squash, zucchini, pumpkin, and acorn squash. 
The squash vine borer is native to North America, with some reports as far south as Brazil and Argentina.  It lives in most temperate North American states, except the Pacific coast. Southern states have two broods a year.

Control
Pesticides are ineffective after the larvae are inside the plant. Gardeners find this a difficult pest to combat. Some try to avoid the pest by timing the production season to harvest before the pests can build up, or after they have peaked.

Prevention includes pesticides to kill the adult moth (such use must not contaminate the flowers, as pollinators would be killed by poisoned nectar or pollen). Preventing it is difficult. One way is to extract the caterpillar from the stem of the plant.

The following organic methods of control are quite manual and may only apply to small-scale or home gardeners. BT (Bacillus thuringiensis) bacteria may be injected into the base of the stem using a syringe, to attempt to kill the larvae, ideally while still small. It should be done sometime after the first flowers start to show and possibly again after a few weeks.

A small utility knife and tweezers, or other fine tools, may be used to gently cut open the stem and try to extract the larva. Look for a hole in the stem with frass coming out of it. The larva is usually several inches above that point. If this is done in a gentle enough way, and before the moth has caused extensive damage, the exposed stem may be covered with soil, allowing the plant to re-establish roots higher up on the stem, and the plant may be saved.

Organic controls include wrapping the lower stem with nylon stockings or aluminum foil to prevent egg laying, which generally occurs within a couple of inches from the point where the stem emerges from the soil. Row covers can be used up until bloom. An old gardener trick for vining squash and pumpkin cultivars is to cover the vine with earth at various points along its length, inducing rooting at several points, thereby continuing to feed the developing fruit despite the loss of the original stem. However, this only works with the species Cucurbita moschata. After the vine has taken root at multiple points, the infected portion of the plant can be cut off, along with another inch where the larva is eating into healthy tissue, without significant damage to the plant. Some gardeners choose to place a yellow bowl filled with water to attract and drown the adult pest, a method which provides feedback on the current level of infestation. This method, along with daily checking the plants for eggs, is popular with organic gardeners.

Once larvae are present within the stems, control must be quick. Often, the first noticed sign of the infestation is wilting of the vine, and it is too late for control efforts at that point. Experienced gardeners watch the stems for signs of frass protruding from small holes, which is an indicator of the presence of the larva inside. Some gardeners carefully cut the stem along its axis and remove the caterpillar before it ruins the vine. Others use a stiff wire, a needle, or a toothpick to kill the borer without seriously injuring the vine.

Gallery

References

Sesiidae
Agricultural pest insects
Moths described in 1828