{"id":8684,"date":"2025-11-24T10:03:45","date_gmt":"2025-11-24T10:03:45","guid":{"rendered":"https:\/\/serisec.com\/index.php\/2025\/11\/24\/deepseek-r1-makes-code-for-prompts-with-severe-security-vulnerabilities\/"},"modified":"2025-11-24T10:03:45","modified_gmt":"2025-11-24T10:03:45","slug":"deepseek-r1-makes-code-for-prompts-with-severe-security-vulnerabilities","status":"publish","type":"post","link":"https:\/\/serisec.com\/index.php\/2025\/11\/24\/deepseek-r1-makes-code-for-prompts-with-severe-security-vulnerabilities\/","title":{"rendered":"DeepSeek-R1 Makes Code for Prompts With Severe Security Vulnerabilities"},"content":{"rendered":"<p>    DeepSeek-R1 Makes Code for Prompts With Severe Security Vulnerabilities<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n    <!-- no image --><br \/>\n \t<BR><br \/>\n<BR><\/BR><\/p>\n<div>\n<p>A concerning vulnerability in DeepSeek-R1, a Chinese-developed <a href=\"https:\/\/cybersecuritynews.com\/artificial-intelligence-and-the-evolution\/\" target=\"_blank\" rel=\"noreferrer noopener\">artificial intelligence<\/a> coding assistant. When the AI model encounters politically sensitive topics related to the Chinese Communist Party, it produces code with severe security flaws at rates up to 50% higher than usual.<\/p>\n<p>Released in January 2025 by Chinese AI startup DeepSeek, the <a href=\"https:\/\/cybersecuritynews.com\/tinyzero\/\" target=\"_blank\" rel=\"noreferrer noopener\">R1 model<\/a> initially appeared comparable to Western competitors in coding quality.<\/p>\n<p>However, CrowdStrike Counter Adversary Operations conducted extensive testing using 30,250 prompts per model, evaluating code across ten security categories.<\/p>\n<p>Crowdstrike researchers inserted politically neutral contextual modifiers into system prompts before coding tasks, ensuring that the prompts would not affect code quality.<\/p>\n<p>The baseline testing showed that <a href=\"https:\/\/cybersecuritynews.com\/threat-actors-leverages-deepseek-r1-popularity\/\" target=\"_blank\" rel=\"noreferrer noopener\">DeepSeek-R1<\/a> produced vulnerable code in just 19% of cases without trigger words, demonstrating strong coding capabilities.<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEiDWtIOL0Lt7IidENoPDENUFbUO6Wih_6d6JpvDHJvSkg76M3qUOoc8-EV4FeRHCnYxZwbi_A4L7uLRwLEQe7ZPJJAwz6BRn___tlj63wY5mYp7srFTmv8XS9nliGo_-g8AlRlya3gszCBlC8d1tX7V8bYzvhfqDwEqTI7nH70wn6lMtbWfuIsaeqwoE90\/s1600\/Screenshot%25202025-11-24%2520111509%2520%25281%2529.webp?ssl=1\" alt=\"A more complex prompt designed to trigger negative behavior in DeepSeek-R1\"><figcaption class=\"wp-element-caption\"><em>A more complex prompt designed to trigger negative behavior in DeepSeek-R1<\/em><\/figcaption><\/figure>\n<p>This changed dramatically when researchers added references to topics the CCP considers sensitive.<\/p>\n<p>When prompted to write code for systems \u201cbased in Tibet,\u201d DeepSeek-R1\u2019s vulnerability rate jumped to 27.2% nearly 50% higher than baseline. Similar increases were observed in mentions of Falun Gong and Uyghurs.<\/p>\n<p>These contextual modifiers were totally irrelevant to the actual coding tasks, meaning they should not have affected output quality under normal circumstances.<\/p>\n<h2 class=\"wp-block-heading\" id=\"h-political-triggers-compromise-code-security\"><strong>Political Triggers Compromise Code Security<\/strong><\/h2>\n<p>In one demonstration, CrowdStrike researchers requested PayPal integration code for a Tibetan financial institution. Without the geographic modifier, DeepSeek-R1 produced secure, production-ready code.<\/p>\n<p>Given the mention of \u201cTibet,\u201d the output contained hard-coded secrets, insecure data-extraction methods, and invalid PHP syntax. Yet, the model insisted its implementation followed \u201cPayPal\u2019s best practices.\u201d<\/p>\n<p>Crowdstrike Researchers <a href=\"https:\/\/www.crowdstrike.com\/en-us\/blog\/crowdstrike-researchers-identify-hidden-vulnerabilities-ai-coded-software\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">discovered<\/a> an \u201cintrinsic kill switch\u201d within DeepSeek-R1\u2019s architecture.<\/p>\n<p>In 45% of cases involving Falun Gong, the model refused to generate code entirely, despite producing detailed reasoning and implementation plans internally.<\/p>\n<p>This behavior is embedded in the model weights themselves, not in external <a href=\"https:\/\/cybersecuritynews.com\/docker-1-click-rce-attack\/\" target=\"_blank\" rel=\"noreferrer noopener\">API<\/a> restrictions.<\/p>\n<p>Chinese law requires AI services to \u201cadhere to core socialist values\u201d and to avoid content that threatens national security.<\/p>\n<p>CrowdStrike suggests DeepSeek\u2019s training pipeline incorporated these requirements, potentially causing the model to associate sensitive keywords with negative characteristics.<\/p>\n<p>An example of misalignment where the AI behaves in unexpected ways due to its training goals.<\/p>\n<figure class=\"wp-block-image size-large\"><img data-recalc-dims=\"1\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEgluvM4PLqR_ryjQuSZWKurbDj2eO_uxKAB1Aa26l1aRRYKfMR9yrOKjZR2bjLw7YzibFVldx5TK9_RfR3FBu9MaBktr3tqGdDuM-V3BCwYHpyKzdyzTEX3CnBqGyuNUtlCFANnzgV2eqk1Ara2t_E9-fpiTSyGMv05_OSngUyLWWYHtAZRin_t8Wq27yo\/s1600\/Screenshot%25202025-11-24%2520111538%2520%25281%2529.webp?ssl=1\" alt=\"Screenshots of the \u201cUyghurs Unchained\u201d web app created by DeepSeek-R1\"><figcaption class=\"wp-element-caption\"><em>Screenshots of the \u201cUyghurs Unchained\u201d web app created by DeepSeek-R1<\/em><\/figcaption><\/figure>\n<p>With approximately 90% of developers using <a href=\"https:\/\/cybersecuritynews.com\/cline-ai-coding-agent-vulnerabilities\/\" target=\"_blank\" rel=\"noreferrer noopener\">AI coding assistants<\/a> by 2025, systemic security issues in these tools present both high-impact and high-prevalence risks.<\/p>\n<p>The findings contrast with previous DeepSeek research, which focused on traditional jailbreaks rather than on subtle degradation in coding quality.<\/p>\n<p>CrowdStrike emphasizes that companies deploying AI coding assistants must conduct thorough testing within their specific environments rather than relying solely on generic benchmarks.<\/p>\n<p>The research highlights a new vulnerability surface requiring deeper investigation across all large language models, not just Chinese-developed systems.<\/p>\n<p class=\"has-text-align-center has-background\" style=\"background:linear-gradient(180deg,rgb(238,238,238) 94%,rgb(169,184,195) 100%)\"><strong>Follow us on <a href=\"https:\/\/news.google.com\/publications\/CAAqMggKIixDQklTR3dnTWFoY0tGV041WW1WeWMyVmpkWEpwZEhsdVpYZHpMbU52YlNnQVAB?hl=en-IN&amp;gl=IN&amp;ceid=IN:en\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Google News<\/a>, <a href=\"https:\/\/www.linkedin.com\/company\/cybersecurity-news\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">LinkedIn<\/a>, and <a href=\"https:\/\/x.com\/cyber_press_org\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">X<\/a> for daily cybersecurity updates. <a href=\"https:\/\/cybersecuritynews.com\/contact-us\/\" target=\"_blank\" rel=\"noreferrer noopener nofollow\">Contact us<\/a> to feature your stories.<\/strong><\/p>\n<p>The post <a href=\"https:\/\/cybersecuritynews.com\/deepseek-r1-code-vulnerabilities\/\">DeepSeek-R1 Makes Code for Prompts With Severe Security Vulnerabilities<\/a> appeared first on <a href=\"https:\/\/cybersecuritynews.com\/\">Cyber Security News<\/a>.<\/p>\n<\/div>\n<p> \t<BR><br \/>\n <BR><\/BR><br \/>\n    Abinaya<br \/>\n \t<BR><br \/>\n<BR><\/BR><br \/>\n<a href=\"https:\/\/cybersecuritynews.com\/deepseek-r1-code-vulnerabilities\/\">Go to cyber-security-news<\/a><br \/>\n \t<BR><br \/>\n <BR><\/BR><\/p>\n","protected":false},"excerpt":{"rendered":"<p>DeepSeek-R1 Makes Code for Prompts With Severe Security Vulnerabilities A concerning vulnerability in DeepSeek-R1, a Chinese-developed artificial intelligence coding assistant. When the AI model encounters politically sensitive topics related to the Chinese Communist Party, it produces code with severe security flaws at rates up to 50% higher than usual. Released in January 2025 by Chinese [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[129,63,2069,648],"tags":[130],"class_list":["post-8684","post","type-post","status-publish","format-standard","hentry","category-cyber-security","category-cyber-security-news","category-security-vulnerabilities","category-vulnerability-news","tag-cyber-security-news"],"_links":{"self":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/8684"}],"collection":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/comments?post=8684"}],"version-history":[{"count":0,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/posts\/8684\/revisions"}],"wp:attachment":[{"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/media?parent=8684"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/categories?post=8684"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/serisec.com\/index.php\/wp-json\/wp\/v2\/tags?post=8684"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}