Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion explain_this_repo/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -325,4 +325,4 @@ def main():


if __name__ == "__main__":
main()
main()
2 changes: 1 addition & 1 deletion explain_this_repo/prompt.py
Original file line number Diff line number Diff line change
Expand Up @@ -131,4 +131,4 @@ def build_simple_prompt(
Make it feel like a human developer explaining to another developer in simple terms.
""".strip()

return prompt
return prompt

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

security-high high

The function build_simple_prompt constructs a prompt for a Large Language Model (LLM) by directly embedding content fetched from a GitHub repository (readme, tree_text). This content is considered untrusted user input. A remote attacker can craft a malicious README file or source code within a repository that contains instructions to manipulate the LLM. When the application processes this malicious repository, these instructions are injected into the prompt, which could cause the LLM to ignore its original purpose, reveal sensitive information like its system prompt, or generate malicious content.

This is possible because the repository content is not sanitized before being included in the prompt. Furthermore, a path traversal vulnerability in explain_this_repo/cli.py allows an attacker to point the tool to an arbitrary, malicious repository, making this vulnerability easily exploitable.