-
Notifications
You must be signed in to change notification settings - Fork 46
Security: Sensitive Information Exposure in TunnelInfo Model #776
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?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,7 +1,7 @@ | ||
| from datetime import datetime | ||
| from typing import List, Optional | ||
|
|
||
| from pydantic import BaseModel, Field | ||
| from pydantic import BaseModel, Field, SecretStr | ||
|
|
||
|
|
||
| class TunnelInfo(BaseModel): | ||
|
|
@@ -11,16 +11,16 @@ class TunnelInfo(BaseModel): | |
| name: Optional[str] = Field(None, description="Friendly name") | ||
| hostname: str = Field(..., description="Tunnel hostname") | ||
| url: str = Field(..., description="Full HTTPS URL") | ||
| frp_token: str = Field(..., description="Authentication token for frpc") | ||
| binding_secret: str = Field("", description="Per-tunnel secret for frpc metadata") | ||
| frp_token: SecretStr = Field(..., description="Authentication token for frpc") | ||
| binding_secret: SecretStr = Field(default=SecretStr(""), description="Per-tunnel secret for frpc metadata") | ||
|
Comment on lines
+14
to
+15
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
With these fields now typed as Useful? React with 👍 / 👎. |
||
| server_host: str = Field(..., description="frps server hostname") | ||
| server_port: int = Field(7000, description="frps server port") | ||
| local_port: Optional[int] = Field(None, description="Local port forwarded by the tunnel") | ||
| labels: List[str] = Field(default_factory=list, description="Tunnel labels") | ||
| http_user: Optional[str] = Field( | ||
| None, description="HTTP basic auth username, if auth is enabled" | ||
| ) | ||
| http_password: Optional[str] = Field( | ||
| http_password: Optional[SecretStr] = Field( | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. http_password returns SecretStr not strMedium Severity The Reviewed by Cursor Bugbot for commit 01fa645. Configure here. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
When Useful? React with 👍 / 👎. |
||
| None, | ||
| description=( | ||
| "Auto-generated HTTP basic auth password. Only present in the " | ||
|
|
||


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.
SecretStr masked in frpc config
High Severity
TunnelInfonow typesfrp_tokenandbinding_secretasSecretStr, but_write_frpc_configstill embeds them in f-strings. Pydantic masksSecretStrin string conversion, so the generated frpc config gets placeholder values instead of the real token and binding secret, and the client cannot authenticate to frps.Reviewed by Cursor Bugbot for commit 01fa645. Configure here.