Xu Shang (徐商), courtesy name Yisheng (義聲) or Qiuqing (秋卿), formally Viscount of Dongguan (東莞子), was an official of the Chinese dynasty Tang Dynasty, serving as a chancellor during the reign of Emperor Yizong of Tang.
It is not known when Xu Shang was born. He was a fifth-generation descendant of Xu Yougong (徐有功), a famed judge during the reign of Wu Zetian. His family claimed to be originally descended from mythical Xia Dynasty judge Gao Yao and traced its ancestry through a line of officials of Qin Dynasty, Han Dynasty, Cao Wei, Jin Dynasty (265-420), Liu Song, Southern Qi, Liang Dynasty, Chen Dynasty, and Tang Dynasty. His father Xu Zai (徐宰) served as a judge at the supreme court (大理寺, Dali Si). Xu Shang had at least one younger brother, Xu Gong (徐宮). By Xu Zai's time, the family was living in Xinzheng (新鄭, in modern Zhengzhou, Henan). In Xu Shang's youth, he was a hermit in the Zhongtiao Mountains (中條山), but he later came out of the hermit living and passed the imperial examinations in the Jinshi class.
During Emperor Xuānzong's reign
Some time during the Dazhong era (847-860) of Emperor Xuānzong, Xu Shang was promoted to be Shangshu Zuo Cheng (尚書左丞), one of the secretaries general of the executive bureau of government (尚書省, Shangshu Sheng). At a later point, Emperor Xuānzong sent him to survey the border regions and to issue edicts in those regions. He was then made the military governor (Jiedushi) of Hezhong Circuit (河中, headquartered in modern Yuncheng, Shanxi). While he was serving there, there were a group of Tujue remnants who crossed the Yellow River and submitted to him. He settled them and organized them into an elite fighting force of 1,000 men.
Xu was later transferred to Shannan East Circuit (山南東道, headquartered in modern Xiangfan, Hubei). As Shannan East had rugged terrain, there were many mountains where bandits gathered. Xu trained an elite group of soldiers to combat banditry. As of 858, when a mutiny at Hunan Circuit (湖南, headquartered in modern Changsha, Hunan) expelled the governor (觀察使, Guanchashi) Han Cong (韓悰), Xu sent these elite soldiers to suppress the Hunan mutiny. He also sent some of his elite soldiers, under his officer Han Jiyou (韓季友), to aid Wei Zhou (韋宙) the governor of Jiangxi Circuit (江西, headquartered in modern Nanchang, Jiangxi) in combating a mutiny at Jiangxi, and subsequently Wei was able to suppress the mutiny there.
During Emperor Yizong's reign
Early in the Xiantong era (860-874) of Emperor Xuānzong's son Emperor Yizong, Xu Shang was recalled to the capital Chang'an to serve as the minister of justice (刑部尚書, Xingbu Shangshu) and the director of the salt and iron monopolies; he was also created the Viscount of Dongguan In 865, by which time he was apparently serving as chief imperial censor (御史大夫), he was made the deputy minister of justice (刑部侍郎, Xingbu Shilang) and given the designation Tong Zhongshu Menxia Pingzhangshi (同中書門下平章事), making him a chancellor de facto. In 869, he was sent out of Chang'an to serve as the military governor of Jingnan Circuit (荊南, headquartered in modern Jingzhou, Hubei), continuing to carry the Tong Zhongshu Menxia Pingzhangshi as an honorary title. He died while serving there, although the date is not known. His son Xu Yanruo later served as a chancellor during the reign of Emperor Yizong's son Emperor Zhaozong.