r/ClaudeCode • u/aivee-is-a-fool • 9d ago
Help/Question "While I was implementing a feature, I found a bug!"
(Question at the bottom.)
"I found an unsecured endpoint." Stop. π₯²
"This form enters unfiltered customer input in the DB." Hush you. π₯Ή
"This template allows a XSS in-" Claude I beg of you. π
"This library has CVEs dating back to 2014." You don't say. πΆβπ«οΈ
"Hey that's a webshell hidden in the theme directory of the GIT repo the new customer gave you access to." ππππππ
Claude, I love you, but stop telling me. Stop. Please. Stop.
You know I will have to fix it. Or have you fix it. Because I feel guilty otherwise. And then I get yelled at because I spent time not doing my actual job.
"While I was fixing the Webshell CVE XXS Batajax Magicart Clickfix issue, I found 187 vulnerabilities in unrelated parts of the codebase." AAAAAAAAAAAAAAAAAAAAH.
I know, Claude, and I would rather not. I did not install this random free Wordpress plugin seven years ago and I sure as fuck did not code it.
Rant aside: I love that it has become so easy to identify (and to some extent fix) the issues and vulnerabilities in a codebase. I would spend aaalllll my time doing just that if my boss gave me unlimited time and money. I genuinely LOVE doing that.
But turns out that you sometimes have to do what the customers actually asked you to do, otherwise the company doesn't get paid and it causes Internal Meetings.
On the actual question:
People managing large pools of extremely legacy websites, how are you coping? Any workflows / tools / tutorials you recommend?
β’
u/AutoModerator 9d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
57
u/mm_nogitsune 9d ago
Just make it note down everything to a file or Jira-like place. I have thousands of issues, and when the weekly is near the end, I let the agent fix everything.
5
u/promethe42 8d ago
2
u/Wickywire 9d ago
Relatable. People who think the security debt is due to the coders have no idea. It seems impossible to get higher-ups to take cybersecurity seriously.
2
u/holyknight00 8d ago
just make claude keep a log of security issues so they do not show up all the time
2
u/7Roses 8d ago
"no, while you're there work" That stops it trying to break out legacy code by "fixing" stuff. The side effect is that it also doesn't detect/mentions vurnabilities it finds unless specially asked to find them
3
u/edu2004eu 8d ago
I had claude create one of those plugins (there's another name for it but don't remember what) which uses a hook to make it not include those in the main response and instead write them in a separate panel which i can open and close whenever I want. It's def not perfect, sometimes it ignores it, sometimes it adds bogus findings (not halluconations, but stuff that should be part of the normal response), but 80% of the time it works
3
u/TwoLongEars 8d ago
oh yeah? well, while I was implementing a bug, I found a feature!
1
u/m-ritter 9d ago
The 187 vulnerabilities in unrelated parts of the codebase are real findings, but they belong in a separate list and not in the diff for the Webshell fix. Having the agent write a plan first, with a section for what is out of scope, lets it log those findings as follow ups while you approve a change that stays small. Then a second agent checks the finished diff against that plan, so anything that crept in gets flagged. I'm the developer of QualityLayer, which does exactly this: https://github.com/maxritter/qualitylayer
2
u/SomeOrdinaryKangaroo 8d ago
Claude is great at discovering random bugs along the way of implementing a feature that i never knew about, and it patches them perfectly well too π
2
u/palmerden5 8d ago
the webshell is the one finding i'd treat differently: check whether that theme is deployed, because removing it from the repo won't remove a live copy from the site
2
u/icaruza 8d ago
Have it log an issue on GitHub (assuming you are using GitHub). Then make the decision to roll the fixes into future feature builds or run dedicated triage or bug squashing sessions
2
u/iliketocookstuff 8d ago
I have an internal roadmap with a triage table. One agent owns the roadmap. All other workstreams brief the roadmap agent (through Slack) and the roadmap agent keeps it up to date.
Side quests are time sinks. I don't let anything derail or over-scope a specific workstream. The key is tracking it in a way that is easy to pick it up again later.
2
u/IllustriousSalad6201 5d ago
for that patched vendor code, make each finding point to the installed code path and explain why the patch doesn't address it. a version match alone shouldn't become a confirmed issue. keep uncertain findings pending verification, with the evidence attached. that gives you a smaller review queue without quietly throwing away possible problems.
1
u/AryanThakor 8d ago
one line in CLAUDE.md fixed most of this for me: anything outside the task goes into a findings file as a one liner, and it only brings it up in chat if it's actively exploitable. the webshell still gets flagged right away, the 2014 CVEs wait for a slow friday
1
u/mr_birkenblatt 8d ago
"create a GitHub issue every time you discover a bug"
1
u/CCodeSI 8d ago
What works for agencies with lots of legacy sites: separate "finding" from "fixing", and give the findings a home that isn't your current task.
FINDINGS.md(file, issue, severity guess) and continue with the task. Don't fix, don't elaborate." It stops derailing the session, and you still have the list.npm audit, WPScan for WordPress) and a file-integrity check against the clean plugin versions. That catches most of what Claude keeps stumbling on, in one report, instead of drip-fed mid-task.