Repository navigation
fix(wework): compile browser data clearing on Windows #2473
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
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
25da1ec
fix(wework): check Windows browser data clearing
qdaxb 9c5b387
test(ci): scope Wework Windows Rust check
qdaxb 9f805e5
fix(wework): avoid Windows result type shadowing
qdaxb e1f2096
Merge branch 'main' into fix/windows-webview2-data-clearing
qdaxb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: wecode-ai/Wegent
Length of output: 5693
🌐 Web query:
actions/checkout persist-credentials default true README💡 Result:
In the actions/checkout GitHub Action, the persist-credentials input determines whether the authentication token or SSH key used for the checkout is configured with the local git config [1][2][3]. Key details include: - Default Value: The default is true [1][2][3]. - Functionality: When set to true, the action configures the local git environment with the necessary credentials, allowing your workflow steps to execute authenticated git commands (e.g., git push or git pull) without additional manual configuration [1][4][3]. - Security: Credentials are automatically removed during the post-job cleanup process [1][4][3]. Recent updates have improved security by storing these credentials in a file under $RUNNER_TEMP rather than directly within the.git/config file [5][6]. - Opt-out: You can disable this behavior by setting persist-credentials to false [1][4][3]. This is recommended if you do not need to run authenticated git commands in subsequent steps or wish to manage credentials manually [1][4][3].
Citations:
🌐 Web query:
GitHub Actions GITHUB_TOKEN permissions persisted credentials Rust build scripts procedural macros unsafe code documentation💡 Result:
In the context of GitHub Actions and Rust development, the primary security concern involves the potential for malicious code execution during the compilation phase to access and exfiltrate sensitive environment credentials, such as the GITHUB_TOKEN [1]. Key Security Considerations: 1. GITHUB_TOKEN Permissions: GitHub Actions automatically provides a short-lived GITHUB_TOKEN for every job [2][3]. By default, this token may have broad permissions depending on repository settings [4][5]. To mitigate risk, you should follow the principle of least privilege: - Set default permissions to read-only at the organization or repository level [5][6]. - Use the permissions key in your workflow YAML to explicitly grant only the necessary permissions for each job [3][7][8]. - Use permissions: {} at the workflow level to disable all permissions by default, then elevate them only as required for specific jobs [4][8]. 2. Rust Build Scripts and Procedural Macros: Both build.rs scripts and procedural macros are executed at compile time by the host machine (the CI runner) with the same privileges as the cargo process [9][1]. If a dependency in your project includes malicious code within these components, it can execute arbitrary commands in your CI environment [1]. This allows it to: - Access environment variables, including the GITHUB_TOKEN and other secrets [1]. - Exfiltrate source code or sensitive data [1]. - Inject backdoors or malicious logic into your project [1]. 3. Mitigation Strategies: - Audit Dependencies: Because procedural macros run during compilation, they are essentially privileged dependencies [1]. Consider using tools like cargo-vet to manage and audit the security of your dependencies, especially those that include procedural macros [1]. - Isolate CI Runners: Avoid using CI runners that have access to production credentials for building untrusted or unverified code [1]. - Limit Exposure: Minimize the scope of the GITHUB_TOKEN to prevent attackers from using it to modify repository contents or publish releases if a build script or macro is compromised [4][8]. - Review Build Scripts: Manually review build.rs files for suspicious network activity or file system access, as these are often overlooked compared to standard application code [1]. Because there is currently no native sandboxing for procedural macros or build scripts within the Rust toolchain, relying on strict environment isolation and thorough dependency auditing is essential to maintaining the security of your CI/CD pipeline [9][1].
Citations:
Disable persisted checkout credentials before Rust compilation.
This workflow runs untrusted PR code in
cargo check, andactions/checkout@v4preserves credentials for later steps. Setpermissions: { contents: read }on the job andpersist-credentials: falseon checkout to reduce token access by build scripts or macros.🧰 Tools
🪛 zizmor (1.29.0)
[warning] 400-401: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false
(artipacked)
🤖 Prompt for AI Agents
Source: Linters/SAST tools