The Wayback Machine - https://web.archive.org/web/20240324153550/https://github.com/github/codeql/issues/12409
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

cpp/potential-system-data-exposure: Does printing a username from getpwuid() count as potential exposure of sensitive system data? #12409

Open
ryao opened this issue Mar 6, 2023 · 1 comment
Labels
question Further information is requested

Comments

@ryao
Copy link

ryao commented Mar 6, 2023

https://github.com/ryao/zfs/security/code-scanning/824

https://github.com/ryao/zfs/blob/3881dd42bbfb7297f08e796c38b35d54e11ac500/cmd/zpool/zpool_main.c#L9431-L9431

Does telling a user his own username really count as potential exposure of sensitive information?

I guess this could be dependent on your threat model since a threat model for an IoT device is certainly different from a threat model for a standard multi-user system. However, I wonder if a username, which is public information in most threat models for C/C++ software, really should be counted as sensitive information by cpp/potential-system-data-exposure.

@ryao ryao added the question Further information is requested label Mar 6, 2023
@ryao ryao changed the title cpp/potential-system-data-exposure: Does printing a username from getpwuid() count as potential exposure of sensitive system? cpp/potential-system-data-exposure: Does printing a username from getpwuid() count as potential exposure of sensitive system data? Mar 6, 2023
@redsun82
Copy link
Contributor

redsun82 commented Mar 6, 2023

You are right that the sensitiveness of the username is dependent on the thread model, but that means in the end that it depends on the context in which the C++ program is being run. There are relevant cases when printing the OS username can expose information usable by an attacker, and CodeQL analysis can not really take into account the context in which the whole program is being run. For reference, here's the relevant CWE.

Maybe long term we could think of ways to customise sensitive data categorisation, but until then I guess the only possibility is to consciously dismiss such alerts.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
2 participants