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

CodeQL is reporting "Security" issues in Jamulus source #3161

Closed
pljones opened this issue Aug 28, 2023 · 5 comments · Fixed by #3164
Closed

CodeQL is reporting "Security" issues in Jamulus source #3161

pljones opened this issue Aug 28, 2023 · 5 comments · Fixed by #3164
Assignees
Labels
bug Something isn't working

Comments

@pljones
Copy link
Collaborator

pljones commented Aug 28, 2023

Describe the bug

CodeQL has been reporting the following "Security" issues in src/client.cpp:

Multiplication result converted to larger type High
# 18 opened January 10, 2021 05:44 • Detected by CodeQL in src/client.cpp:1314 main
Multiplication result converted to larger type High
# 17 opened January 10, 2021 05:44 • Detected by CodeQL in src/client.cpp:1268 main
Multiplication result converted to larger type High
# 16 opened January 10, 2021 05:44 • Detected by CodeQL in src/client.cpp:1260 main

which were closed as "Won't fix". Re-opening this as an issue.

To Reproduce

View the "Security" tab, "Code scanning alerts"->"View alerts" with the "open" filter removed.

Expected behavior

We shouldn't have any type "High" security defects.

Every build should report the CodeQL security defects in Jamulus src clearly.

@pljones pljones added the bug Something isn't working label Aug 28, 2023
@pljones pljones added this to the Release 3.11.0 milestone Aug 28, 2023
@pljones pljones self-assigned this Aug 28, 2023
@ann0see
Copy link
Member

ann0see commented Aug 28, 2023

Agree. Security issues must be taken seriously! It's a numeric overflow - maybe we need to use a greater immediate type?

@pljones
Copy link
Collaborator Author

pljones commented Aug 28, 2023

Every build should report the CodeQL security defects in Jamulus src clearly.

Currently, the CodeQL process appears to kick off only when a "build all targets" autobuild runs.

I've not yet understood when the Security tab picks the results up - it appears there's a configuration somewhere that's related to the above, but I'm not sure how.

@hoffie if you're around, can you remember?

softins added a commit to softins/jamulus that referenced this issue Aug 29, 2023
@softins
Copy link
Member

softins commented Aug 29, 2023

I've pushed a branch to my repo that I think should fix this easily. See softins@e12c000

It compiles without warnings and doesn't appear to flag the branch under Security.

I can raise it as an alternative PR to #3162 if @pljones is happy.

softins added a commit to softins/jamulus that referenced this issue Aug 29, 2023
@softins
Copy link
Member

softins commented Aug 29, 2023

In fact, an even better solution is to completely remove the multiplication from the index, and just step an index by the multiplication factor. See softins@a3885ac

I can raise this as a PR instead if @pljones is happy.

@pljones
Copy link
Collaborator Author

pljones commented Aug 29, 2023

Yep, looks good.

softins added a commit that referenced this issue Aug 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging a pull request may close this issue.

3 participants