-
Notifications
You must be signed in to change notification settings - Fork 2
release: 2.4.0-rc1 #251
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
release: 2.4.0-rc1 #251
Conversation
c5d4658 to
03828db
Compare
HackerOne Code Security Review🟢 Scan Complete: ✔️ No issues detected *We want to surface issues only when necessary and actionable. If we didn't get something right, or if there's more context we should take into account, reply to the comment so we'll know for the future. Here's how the code changes were interpreted and info about the tools used for scanning. 🧰 Analysis tools
⏱️ Latest scan covered changes up to commit 975f9e0 (latest) |
|
✅ Graham C reviewed all the included code changes and associated automation findings and determined that there were no immediately actionable security flaws. Note that they will continue to be notified of any new commits or comments and follow up as needed throughout the duration of this pull request's lifecycle. Reviewed with ❤️ by PullRequest |
|
Graham C has submitted feedback. Reviewed with ❤️ by PullRequest |
| class MessageContentMixedContentImageFragmentImageURL(TypedDict, total=False): | ||
| """The image URL object containing the location of the image.""" | ||
|
|
||
| url: Required[str] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The url field accepts any string without validation, creating a potential Server-Side Request Forgery (SSRF) vulnerability. This field can contain external URLs or base64-encoded data URIs. Without validation, an attacker could provide URLs to internal services (like http://localhost:6379 or cloud metadata endpoints at http://169.254.169.254/) that the server can access but external users cannot.
According to the OWASP Input Validation Cheat Sheet, URL inputs should validate: allowed protocols (typically only https:// for external URLs), that destinations are not private IP ranges or localhost, and maximum string length. For base64 data URIs, validate the decoded size to prevent memory exhaustion.
Remediation:
Add validation in the API handler before processing URLs:
- Parse and verify scheme is
https(ordatafor base64) - For https URLs, block localhost, private IPs (10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16, 127.0.0.0/8)
- Enforce max length (e.g., 10KB for URLs, 10MB for data URIs)
- For data URIs, validate MIME type and decoded size
References:
- https://cheatsheetseries.owasp.org/cheatsheets/Server_Side_Request_Forgery_Prevention_Cheat_Sheet.html
- https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html
🔸 Vulnerability (Warning)
| class GraphToolFunction(BaseModel): | ||
| """A tool that uses Knowledge Graphs as context for responses.""" | ||
|
|
||
| graph_ids: List[str] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The graph_ids field accepts a list of strings without maximum length validation on either array size or individual elements. An attacker could provide an extremely large array or very long ID strings, leading to memory exhaustion and denial of service. When processing queries against specified graphs, this could also cause database performance issues.
The OWASP Input Validation Cheat Sheet states that array inputs must have maximum length validation to prevent resource exhaustion. Without bounds, attackers can force excessive memory allocation, iterate over unreasonable item counts, or construct database queries with massive IN clauses. Note that the TypedDict version in src/writerai/types/shared_params/tool_param.py has the same issue.
Remediation:
Add Pydantic field validators:
from pydantic import field_validator
@field_validator('graph_ids')
@classmethod
def validate_graph_ids(cls, v):
if len(v) > 50:
raise ValueError('graph_ids cannot exceed 50 items')
for graph_id in v:
if len(graph_id) > 256:
raise ValueError('individual graph_id cannot exceed 256 characters')
return vReferences:
- https://cheatsheetseries.owasp.org/cheatsheets/Input_Validation_Cheat_Sheet.html
- https://docs.pydantic.dev/latest/concepts/validators/
🔸 Vulnerability (Warning)
03828db to
565e903
Compare
565e903 to
56ab08c
Compare
56ab08c to
8a5e0d0
Compare
8a5e0d0 to
24004a4
Compare
24004a4 to
aa2cbf0
Compare
aa2cbf0 to
4077eaa
Compare
Manually adding the default_retires config to the stainless config
4077eaa to
ea02763
Compare
ea02763 to
9682fc1
Compare
Manually updated max_retries param
9682fc1 to
975f9e0
Compare
|
🤖 Release is at https://github.com/writer/writer-python/releases/tag/v2.4.0-rc1 🌻 |
Automated Release PR
2.4.0-rc1 (2026-01-12)
Full Changelog: v2.3.3-rc1...v2.4.0-rc1
Features
Bug Fixes
Chores
--fixargument to lint script (4b3b067)Documentation
This pull request is managed by Stainless's GitHub App.
The semver version number is based on included commit messages. Alternatively, you can manually set the version number in the title of this pull request.
For a better experience, it is recommended to use either rebase-merge or squash-merge when merging this pull request.
🔗 Stainless website
📚 Read the docs
🙋 Reach out for help or questions