Origin of the term crab apple:
The crab apple is actually the wild apple, source of all domestic apples grown today. There are two thoughts about the origin of crab in this sense. The first notes that the Scottish form is scrab or scrabbe, seemingly from a Norse source, as there is Swedish skrabba "fruit of the wild apple tree". This would suggest that crab and crabbe are aphetic forms of a much older word.
The other possibility is that it derives from crabbed, which itself means, etymologically, "crooked or wayward gait of a crab" and the several figurative senses that follow from that (disagreeable, contrary, ill-tempered, or crooked). One of those senses might have been applied to the fruit of the crab apple: not right, not pleasant, ill-flavored (because crab apples are very sour and astringent).
Whatever crab apple's origin, it dates from 1712, while the term crab "crab apple" dates from the early 15th century. Crabbed dates from about 1300.
According to this site, the term has a Scandinavian origin...
crab (n) A kind of apple. Swe krabbäple (a crab-apple). Perhaps allied to 'crab' in the sense of 'pinching, sour'.
http://www.viking.no/e/england/e-viking_words_2.htm