Tool updates: lots of security and logic fixes, (Mon, Mar 23rd)
嗯,用户让我用中文总结一篇文章,控制在100字以内,而且不需要特定的开头。首先,我需要理解文章的内容。文章讲的是作者使用Claude Code等工具来审查自己的Python脚本,发现了多个安全问题,比如逻辑错误、权限问题等。这些脚本原本是快速解决个人问题的,后来公开在GitHub上,但没有经过充分测试。作者意识到需要将AI工具整合到日常工作中,以提高代码质量。 接下来,我需要提炼关键点:使用AI审查脚本、发现多个安全问题、公开脚本未充分测试、强调AI的重要性。然后,把这些点浓缩成一句话,不超过100字。 可能的结构是:作者通过AI审查发现脚本中的安全漏洞,并意识到需要将AI整合到日常工作中。 现在,组织语言:“作者通过AI工具审查自己的Python脚本,发现了多个安全漏洞,并意识到需要将AI整合到日常工作中以提高代码质量。” 检查字数:刚好在100字以内。看起来不错。 </think> 作者通过AI工具审查自己的Python脚本,发现了多个安全漏洞,并意识到需要将AI整合到日常工作中以提高代码质量。 2026-3-23 20:39:5 Author: isc.sans.edu(查看原文) 阅读量:2 收藏

So, I've been slow to get on the Claude Code/OpenCode/Codex/OpenClaw bandwagon, but I had some time last week so I asked Claude to review (/security-review) some of my python scripts. He found more than I'd like to admit, so I checked in a bunch of updates. In reviewing his suggestions, he was right, I made some stupid mistakes, some of which have been sitting in there for a long time. It was nothing earth-shattering and it took almost no time for Claude, it took longer for me to read through the updates he wanted to make, figure out what he was seeing, and decide whether to accept them or tweak them. Here are a few of them.

  • a logic inversion error with the -f switch, and some unhandled errors in convert-ts-bash-history.py
  • a TOCTOU (time of check/time of use) possible race condition, and a comment about some ambiguity with the -c switch when deciding which hash was used based solely on the length of the hash in sigs.py
  • some overly permissive permissions, a possible symlink attack, and an encoding issue in ficheck.py
  • a possible header injection issue via the -s switch with mail_stuff.py

Most of these are issues I should have caught myself given how long I've been programming/scripting, but all of these started out as quick and dirty scripts to solve a problem I had, and then I made them available to the public through my github repo without taking any time to really ensure they were ready for public consumption. Taking a few minutes to setup Claude without much in the way of guidance (my CLAUDE.md is still very much a work-in-progress) and the one in my my scripts repo was one I asked Claude to create for me after some back and forth during this review which mostly covers a couple of personal preferences. 

I guess the main point is I'm late to the game on using AI on a daily basis, but that needs to change. Even when I'm feeling my age and write my own scripts, I need to have that second pair of eyes give it a second look. Some of these scripts run as root out of cron or systemd timers on systems I administer and some of those issues could have been used for privilege escalation by an attacker who managed to get access. Even those of us with more grey than not in our beards need to be spending some time figuring out how to integrate this stuff into our daily routine.

References:

[1] https://github.com/clausing/scripts

---------------
Jim Clausing, GIAC GSE #26
jclausing --at-- isc [dot] sans (dot) edu


文章来源: https://isc.sans.edu/diary/rss/32820
如有侵权请联系:admin#unsafe.sh