At some point, Cui Hang passed the imperial examinations in the Jinshi class, although when he did so is not known. He subsequently became a low-level official in one of the ministries at the executive bureau of government. Yet later, he was put in charge of drafting edicts and was made a Zhongshu Sheren, a mid-level official at the legislative bureau. In 872, during the reign of Emperor Yizong, the official Wei Yinyu, whose wife was a cousin of Cui Hang's, submitted a report accusing Guo Jingshu, the brother of Emperor Yizong's favorite concubine Consort Guo, of improprieties. Emperor Yizong, in anger, caned Wei to death and confiscated his assets. Further, Wei's father-in-law Cui Yuanying, Cui Hang, and a cousin of Cui Yuanying's, Cui Junqing were all exiled, as was Wei's friend Du Yixiu, a son of the deceased chancellor Du Cong. In Cui Hang's case, he was made the census officer at Xun Prefecture. After Emperor Yizong died in 873 and was succeeded by his son Emperor Xizong, Cui Hang was moved closer to the capital, to be the prefect of Yong Prefecture. He was subsequently recalled to the capital Chang'an to again serve as Zhongshu Sheren, and then successively as the deputy minister of rites then deputy minister of civil service affairs.
Chancellorship
In 878, when Emperor Xizong decided to remove the chancellors Zheng Tian and Lu Xi over a violent argument that Zheng and Lu had with each other, both Cui Hang and Doulu Zhuan were made chancellors to succeed Zheng and Lu, with the designation Tong Zhongshu Menxia Pingzhangshi. After Lu was restored to the chancellorship in 879, though, Lu was clearly the leader among the chancellors, and Doulu was described as simply following Lu's lead on policies. Further, when Cui would have policy suggestions, Doulu often stopped him from presenting them. There was one major policy decision that he prevailed on — when the warlordWang Jingchong, who controlled Chengde Circuit, also sought to have the imperial government grant him Yiwu Circuit, Cui, pointing out that Chengde, in conjunction with other warlord-controlled circuits Weibo and Lulong, would be even harder to control, refused. By late 880, the major agrarian rebel Huang Chao captured the eastern capital Luoyang and the capital Chang'an. Doulu and Cui suggested sending forces to defend Tong Pass to stop Huang's advance toward Chang'an, but both of them were also suggesting that the contingency plan made by the powerful eunuchTian Lingzi — that Emperor Xizong flee to the Sanchuan region be implemented. After Huang captured Tong Pass and approached Chang'an, Emperor Xizong fled toward Xichuan Circuit, where Tian's brother Chen Jingxuan was military governor. Doulu and Cui, for reasons unknown, were unable to follow Emperor Xizong's flight, and they, along with the former chancellor Liu Ye, hid at the mansion of the general Zhang Zhifang, who had outwardly submitted to Huang upon Huang's entry into Chang'an but was hiding many Tang officials at his mansion. As Qi forces sought to find hiding Tang officials, however, Liu, Doulu, and Cui tried to flee, but were captured. Refusing to submit to Huang, they were executed.