-
Notifications
You must be signed in to change notification settings - Fork 2
release: 2.3.3-rc2 #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
base: main
Are you sure you want to change the base?
release: 2.3.3-rc2 #251
Conversation
c5d4658 to
03828db
Compare
HackerOne Code Security Review🟢 Scan Complete: 5 Issue(s) Here's how the code changes were interpreted and info about the tools used for scanning. 📖 Summary of ChangesThe update involves a minor release candidate revision (2.3.3-rc2) with documentation improvements across multiple files. Key changes include added docstrings for various classes, type-related bug fixes, and minor updates to authentication examples. Dependency lockfiles were also updated with package version bumps. The modifications focus on enhancing code documentation and maintaining library consistency.
ℹ️ Issues DetectedNOTE: These may not require action! Below are unvalidated results from the Analysis Tools that ran during the latest scan for transparency. We investigate each of these for accuracy and relevance before surfacing them as a potential problem. How will I know if something is a problem?
🧰 Analysis tools
⏱️ Latest scan covered changes up to commit 03828db (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
Automated Release PR
2.3.3-rc2 (2025-12-18)
Full Changelog: v2.3.3-rc1...v2.3.3-rc2
Bug Fixes
Chores
--fixargument to lint script (4b3b067)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