⚡Megatron LLM Hub
←Back to search
Twitter

观点:应从源头阻止开发者与 AI agent 写出不安全代码,而非事后打补丁

ai_agentxss
agree! dont give developers or ai agents the ability to write insecure code in the first place. they are pressured to ship working features, security is someone else problem. this is also why "patch the planet" doesn't scale, no matter how hard you try. xss is a pretty good example and probably decade long cat and mouse war against it is fascinating. 1. microsoft/early web designers makes mistake, mix data with executable code. what could possibly go wrong? 2. well, attacker controlled data runs as javascript. rise of xss. 3. microsoft be like, hmm, how do we stop this? let's make cookies not accessible to javascript. creates httponly cookies. 4. well, attacker runs javascript, they can do everything from the browser without stealing cookies 5. security people be like, educate developers, and patch patch patch. 6. samy worm spreads in myspace through xss 7. dang it, lets educate developers to not write insecure code, patch patch patch 8. wait, xss vulnerabilities are not getting exhausting rather raising like crazy, developers still writing insecure code. 9. browser security people decide to fix this once and for all. detect malicious input with heuristics(probably glorious regex? idk some boomer need to teach me how they used to work) and block it. microsoft creates xss filter, google follows with xss auditor. 10. well, parser differentials hit hard, attackers keep bypassing the filters, and the filters themselves introduce new vulnerabilities. google eventually kills xss auditor. 11. mozilla be like, these guys have skill issue. what if we context aware restrict which scripts can execute instead ? invents csp. 12. devs be like, hold my coffee. your security policy is breaking my feature. let me just allow everything, ship ship ship. 13. meanwhile, google and others think, why trust developers to escape everything correctly? build automatic escaping into frameworks. rise of angular and react with secure defaults. 14. bahaha, still more xss. react literally calls its raw html escape hatch dangerouslySetInnerHTML, but dev uses it anyway cuz the feature works. ship it. (they did made rxss harder tho) 15. still more xss. reflected xss hasn't disappeared, and dom xss remains a problem. 16. google thinks harder. let's makes trusted types, lets make devs harder more, stop developers from passing arbitrary strings into dangerous dom sinks. 17. works kinda fine, but no one uses it except probably google and some others, there are probably devs at gogole who still use unsafe trusted policy 18. so, google needs to make observability to catch developers that use it and shame 19. after 10 years, xss volumes goes down. 20. win lesson? you cant just patch your way out of this forever, fixing all bugs is a never ending cat and mouse game, you cant win this game at all. you need make insecure code harder to write in the first place. reduce attack surface, and make dangerous operations difficult or impossible.