arXivDaily arXiv每日学术速递 周一至周五更新
北美退伍军人节(Veterans Day),12 日无更新
arXiv 2103.06091cs.SEcs.CR
收藏

Python和Java API中的盲点导致易受攻击的代码

Blindspots in Python and Java APIs Result in Vulnerable Code

Yuriy Brun, Tian Lin, Jessie Elise Somerville, Elisha Myers, Natalie C. Ebner

摘要:

API中的盲点可能会导致软件工程师引入漏洞,但不幸的是,这种盲点很常见。我们通过复制一个109名开发人员,24名Java-API控制实验,研究了具有盲点的API对两种语言开发人员的影响。我们的复制适用于Python,涉及129名新开发人员和22个新API。我们发现,使用带有盲点的API在统计上显著降低了开发人员在两种语言中正确推理API的能力,但这种影响对Python更为明显。有趣的是,对于Java,这种影响随着依赖API的代码的复杂性而增加,而对于Python,情况正好相反。开发人员是否认为API使用更困难,更不清楚,更不熟悉并不影响他们正确推理的能力。具有较好长期记忆的开发人员更有可能正确地推理具有盲点的API,但短期记忆,处理速度,情景记忆和记忆广度没有影响。令人惊讶的是,专业经验和专业知识并没有提高开发人员对两种语言中存在盲点的API进行推理的能力,具有多年经验的长期专业人员和相对新手一样经常犯错误。最后,性格特征并没有显著影响Python开发人员对带有盲点的API的推理能力,但不那么外向和更开放的开发人员更擅长于对带有盲点的Java API进行推理。总的来说,我们的研究结果表明,API中的盲点是跨语言的一个严重问题,仅凭经验和教育并不能克服这个问题,这表明需要工具来帮助开发人员在编写使用这些API的代码时识别API中的盲点。

英文摘要:

Blindspots in APIs can cause software engineers to introduce vulnerabilities, but such blindspots are, unfortunately, common. We study the effect APIs with blindspots have on developers in two languages by replicating an 109-developer, 24-Java-API controlled experiment. Our replication applies to Python and involves 129 new developers and 22 new APIs. We find that using APIs with blindspots statistically significantly reduces the developers' ability to correctly reason about the APIs in both languages, but that the effect is more pronounced for Python. Interestingly, for Java, the effect increased with complexity of the code relying on the API, whereas for Python, the opposite was true. Whether the developers considered API uses to be more difficult, less clear, and less familiar did not have an effect on their ability to correctly reason about them. Developers with better long-term memory recall were more likely to correctly reason about APIs with blindspots, but short-term memory, processing speed, episodic memory, and memory span had no effect. Surprisingly, professional experience and expertice did not improve the developers' ability to reason about APIs with blindspots across both languages, with long-term professionals with many years of experience making mistakes as often as relative novices. Finally, personality traits did not significantly affect the Python developers' ability to reason about APIs with blindspots, but less extraverted and more open developers were better at reasoning about Java APIs with blindspots. Overall, our findings suggest that blindspots in APIs are a serious problem across languages, and that experience and education alone do not overcome that problem, suggesting that tools are needed to help developers recognize blindspots in APIs as they write code that uses those APIs.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑