Skip to content

Conversation

@eytan-starkware
Copy link
Contributor

@eytan-starkware eytan-starkware commented Jul 27, 2025

Stack:

⚠️ Part of a stack created by spr. Do not merge manually using the UI - doing so may have unexpected results.

@reviewable-StarkWare
Copy link

This change is Reviewable

@eytan-starkware eytan-starkware force-pushed the spr/main/040c517a branch 2 times, most recently from 795aaf6 to f559686 Compare July 28, 2025 08:15
@eytan-starkware eytan-starkware force-pushed the spr/main/040c517a branch 2 times, most recently from db46d1a to bcdfc7d Compare July 28, 2025 13:42
@eytan-starkware eytan-starkware changed the base branch from spr/main/e338f3a3 to main July 29, 2025 06:56
@eytan-starkware eytan-starkware changed the base branch from main to spr/main/e338f3a3 July 29, 2025 06:57
@semgrep-code-starkware-libs
Copy link

Semgrep found 1 tainted-path finding:

  • crates/cairo-lang-executable/src/compile.rs

The application builds a file path from potentially untrusted data, which can lead to a path traversal vulnerability. An attacker can manipulate the path which the application uses to access files. If the application does not validate user input and sanitize file paths, sensitive files such as configuration or user data can be accessed, potentially creating or overwriting files. To prevent this vulnerability, validate and sanitize any input that is used to create references to file paths. Also, enforce strict file access controls. For example, choose privileges allowing public-facing applications to access only the required files.

View Dataflow Graph
flowchart LR
    classDef invis fill:white, stroke: none
    classDef default fill:#e7f5ff, color:#1c7fd6, stroke: none

    subgraph File0["<b>crates/cairo-lang-executable/src/compile.rs</b>"]
        direction LR
        %% Source

        subgraph Source
            direction LR

            v0["<a href=https://github.com/starkware-libs/cairo/blob/96d95c758355d7e1770251fbe490408637bfae5b/crates/cairo-lang-executable/src/compile.rs#L107 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 107] path</a>"]
        end
        %% Intermediate

        %% Sink

        subgraph Sink
            direction LR

            v1["<a href=https://github.com/starkware-libs/cairo/blob/96d95c758355d7e1770251fbe490408637bfae5b/crates/cairo-lang-executable/src/compile.rs#L107 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 107] &path</a>"]
        end
    end
    %% Class Assignment
    Source:::invis
    Sink:::invis

    File0:::invis

    %% Connections

    Source --> Sink

Loading

@eytan-starkware eytan-starkware force-pushed the spr/main/e338f3a3 branch 2 times, most recently from f4813b1 to bb6720a Compare July 29, 2025 12:06
@eytan-starkware eytan-starkware force-pushed the spr/main/040c517a branch 2 times, most recently from 6716593 to ce2bdd4 Compare July 30, 2025 11:31
@eytan-starkware eytan-starkware force-pushed the spr/main/040c517a branch 2 times, most recently from 625d2df to 5aa6456 Compare July 31, 2025 07:50
Base automatically changed from spr/main/e338f3a3 to main July 31, 2025 08:13
Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

Reviewed 12 of 12 files at r1, all commit messages.
Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @eytan-starkware)


crates/cairo-lang-syntax/src/node/element_list.rs line 63 at r1 (raw file):

        Self { _data: data, iter }
    }
}

you can now just fully delete this struct.

Code quote:

/// Iterator over the raw elements of an `ElementList`.
struct ElementListRawIter<'a> {
    /// The `Arc` storing the actual node.
    _data: &'a [SyntaxNode<'a>],
    /// Actual iterator over the elements.
    iter: std::slice::Iter<'a, SyntaxNode<'a>>,
}

impl<'a> ElementListRawIter<'a> {
    fn new(data: &'a [SyntaxNode<'a>]) -> Self {
        let iter = data.iter();
        Self { _data: data, iter }
    }
}

Copy link
Contributor Author

@eytan-starkware eytan-starkware left a comment

Choose a reason for hiding this comment

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

Reviewable status: all files reviewed, 1 unresolved discussion (waiting on @orizi)


crates/cairo-lang-syntax/src/node/element_list.rs line 63 at r1 (raw file):

Previously, orizi wrote…

you can now just fully delete this struct.

Done.

Copy link
Collaborator

@orizi orizi left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 8 of 8 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @eytan-starkware)

@eytan-starkware eytan-starkware added this pull request to the merge queue Aug 3, 2025
Merged via the queue into main with commit 638e9e2 Aug 3, 2025
49 checks passed
@eytan-starkware eytan-starkware deleted the spr/main/040c517a branch August 3, 2025 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants