This paper constructs an overall framework for vulnerability mining, covering the whole process from code collection to vulnerability remediation. The word vector technique is used to transform code fragments into vector form, thus preserving the semantic information of the code. A vulnerability mining system based on semantic graph of source code is further designed, which generates a semantic graph of code by constructing an abstract syntax tree (SAT), and analyzes the semantic graph by using graph neural network to accurately locate potential vulnerabilities. At the same time, a vulnerability repair method based on thought chain is proposed. The results show that the model in this paper can accurately mine the vulnerabilities of web service software, and it consumes short latency and has strong stability. The results of web service software vulnerability detection show that the accuracy rate of the model always stays above 85% under different network structures. In addition, this paper obtains that the integration degree centrality measure and 60 iteration rounds have the best effect on the detection of vulnerabilities of the model. Finally, the vulnerability repair experiments show that at Beams=15, the model in this paper repairs each vulnerability function with a PPP metric of 61.52% and an average time of 3.168 seconds, which is the best for vulnerability repair.