Genesis 40:1

1After these things happened, the cupbearer
The Hebrew term cupbearer corresponds to the Egyptian wb’, an official (frequently a foreigner) who often became a confidant of the king and wielded political power (see K. A. Kitchen, NBD3 248). Nehemiah held this post in Persia.
to the king of Egypt and the royal baker
The baker may be the Egyptian retehti, the head of the bakers, who had privileges in the royal court.
offended
The Hebrew verb translated offended here is the same one translated “sin” in 39:9. Perhaps there is an intended contrast between these officials, who deserve to be imprisoned, and Joseph, who refused to sin against God, but was thrown into prison in spite of his innocence.
their master, the king of Egypt.
Copyright information for NETfull