Skip to content
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

cannon: use constant instead of magic value for solidity part #12486

Closed
wants to merge 3 commits into from

Conversation

Inphi
Copy link
Contributor

@Inphi Inphi commented Oct 16, 2024

ref: #12484
This is a follow-up PR for #12386 one, which does the same to the solidity part.

Copy link
Contributor

semgrep-app bot commented Oct 17, 2024

Semgrep found 3 golang_fmt_errorf_no_params findings:

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.

@Inphi Inphi force-pushed the inphi/trigger-integration branch from 391906f to b62c6c8 Compare October 17, 2024 02:14
Copy link

codecov bot commented Oct 17, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 64.86%. Comparing base (1e59d08) to head (a84a2e4).
Report is 62 commits behind head on develop.

Additional details and impacted files
@@             Coverage Diff             @@
##           develop   #12486      +/-   ##
===========================================
- Coverage    65.04%   64.86%   -0.18%     
===========================================
  Files           54       54              
  Lines         4460     4460              
===========================================
- Hits          2901     2893       -8     
- Misses        1382     1391       +9     
+ Partials       177      176       -1     
Flag Coverage Δ
cannon-go-tests 64.86% <ø> (-0.18%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

see 1 file with indirect coverage changes

@Inphi Inphi force-pushed the inphi/trigger-integration branch 2 times, most recently from 928d968 to 4a0ea04 Compare October 17, 2024 17:09
Copy link
Contributor

semgrep-app bot commented Oct 17, 2024

Semgrep found 1 golang_fmt_errorf_no_params finding:

  • op-supervisor/supervisor/backend/db/db_test.go

No fmt.Errorf invocations without fmt arguments allowed

Ignore this finding from golang_fmt_errorf_no_params.

Semgrep found 6 sol-style-input-arg-fmt findings:

Inputs to functions must be prepended with an underscore (_)

Ignore this finding from sol-style-input-arg-fmt.

Semgrep found 1 math-random-used finding:

  • op-supervisor/supervisor/backend/source/head_monitor_test.go

Do not use math/rand. Use crypto/rand instead.

Ignore this finding from math-random-used.

Semgrep found 1 marshal-json-pointer-receiver finding:

  • op-supervisor/supervisor/backend/db/heads/types.go

MarshalJSON with a pointer receiver has surprising results: golang/go#22967

Ignore this finding from marshal-json-pointer-receiver.

Semgrep found 1 err-nil-check finding:

superfluous nil err check before return

Ignore this finding from err-nil-check.

@Inphi Inphi force-pushed the inphi/trigger-integration branch from 4a0ea04 to ac1abd2 Compare October 21, 2024 14:03
@Inphi Inphi force-pushed the inphi/trigger-integration branch from ac1abd2 to 193eae4 Compare October 22, 2024 19:34
Copy link
Contributor

semgrep-app bot commented Oct 22, 2024

Semgrep found 1 sol-style-require-reason finding:

  • packages/contracts-bedrock/src/L2/SuperchainWETH.sol

require() must include a reason string

Ignore this finding from sol-style-require-reason.

Semgrep found 5 sol-style-input-arg-fmt findings:

Inputs to functions must be prepended with an underscore (_)

Ignore this finding from sol-style-input-arg-fmt.

… the current active thread to exited state (activeThread.Exited = true) to test the wakeup traversal behavior when the active thread has exited && Modified test cases by resetting the active thread's index from exitedThreadIdx to avoid duplicate settings and confusion.
Copy link
Contributor

semgrep-app bot commented Oct 23, 2024

Semgrep found 1 no-direct-write-to-responsewriter finding:

  • op-challenger/game/fault/trace/prestates/multi_test.go

Detected directly writing or similar in 'http.ResponseWriter.write()'. This bypasses HTML escaping that prevents cross-site scripting vulnerabilities. Instead, use the 'html/template' package and render data using 'template.Execute()'.

Ignore this finding from no-direct-write-to-responsewriter.

Semgrep found 1 no-direct-write-to-responsewriter-taint finding:

  • op-challenger/game/fault/trace/prestates/multi_test.go

Untrusted input could be used to tamper with a web page rendering, which can lead to a Cross-site scripting (XSS) vulnerability. XSS vulnerabilities occur when untrusted input executes malicious JavaScript code, leading to issues such as account compromise and sensitive information leakage. To prevent this vulnerability, validate the user input, perform contextual output encoding or sanitize the input. For more information, see: Go XSS prevention.

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

    subgraph File0["<b>op-challenger/game/fault/trace/prestates/multi_test.go</b>"]
        direction LR
        %% Source

        subgraph Source
            direction LR

            v0["<a href=https://github.com/ethereum-optimism/optimism/blob/2ab49867cbd71c2eee68fd81d7070a1930a1a97f/op-challenger/game/fault/trace/prestates/multi_test.go#L194 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 194] r.URL</a>"]
        end
        %% Intermediate

        %% Sink

        subgraph Sink
            direction LR

            v1["<a href=https://github.com/ethereum-optimism/optimism/blob/2ab49867cbd71c2eee68fd81d7070a1930a1a97f/op-challenger/game/fault/trace/prestates/multi_test.go#L194 target=_blank style='text-decoration:none; color:#1c7fd6'>[Line: 194] w.Write([]byte(r.URL.Path))</a>"]
        end
    end
    %% Class Assignment
    Source:::invis
    Sink:::invis

    File0:::invis

    %% Connections

    Source --> Sink

Loading
Ignore this finding from no-direct-write-to-responsewriter-taint.

@Inphi Inphi closed this Oct 24, 2024
@Inphi Inphi deleted the inphi/trigger-integration branch October 24, 2024 17:45
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.

2 participants