Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save vladopajic/0b835b28bcfe4a5a22bb0ae20e365266 to your computer and use it in GitHub Desktop.
Save vladopajic/0b835b28bcfe4a5a22bb0ae20e365266 to your computer and use it in GitHub Desktop.

Risks of Information Leakage through Remote Code Coverage Services

In the realm of Go programming, code coverage reporting tools such as codecov and coveralls have gained significant popularity for assessing code coverage. These services operate remotely and necessitate the submission of coverage profiles (in the form of cover.out files) to their servers. While this is generally unproblematic for open source projects, a word of caution is warranted for closed source projects. The act of sharing your coverage profile can inadvertently disclose critical information about your proprietary source code. The coverage profile files contain an enumeration of all source code files accompanied by their directory structures. This seemingly innocuous information has the potential to be exploited in two ways:

  • Reverse Engineering: Adversaries could leverage the available directory structure and file list to reverse engineer your project. This could readily expose the inner workings, services, and components that constitute your project.

  • Insightful Projections: By scrutinizing the directory hierarchy and list of source files, unauthorized parties could glean insights into the upcoming features or directions of your project, effectively jeopardizing your competitive advantage.

Here's a sample coverage profile to illustrate this potential issue:

mode: atomic
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/check.go:10.60,12.16 2 11
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/check.go:12.16,15.3 2 2
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/check.go:17.2,23.28 4 9
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/check.go:23.28,27.17 3 3
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/config.go:42.34,43.30 1 11
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/config.go:43.30,43.59 1 26
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/config.go:44.2,44.41 1 11
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/config.go:44.41,47.3 2 2
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/cover.go:15.65,17.16 2 11
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/cover.go:17.16,19.3 1 1
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/cover.go:21.2,24.35 3 10
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/cover.go:24.35,26.17 2 46
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/cover.go:26.17,28.4 1 0
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/cover.go:30.3,30.55 1 46
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/report.go:13.56,20.41 5 13
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/report.go:20.41,21.14 1 39
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/report.go:21.14,23.4 1 31
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/report.go:25.3,25.16 1 8
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/report.go:28.2,44.76 10 13
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/report.go:47.71,48.29 1 26
github.com/vladopajic/go-test-coverage/v2/pkg/testcoverage/report.go:48.29,50.3 1 22
... other files

Should you wish to mitigate these concerns, a prudent approach is to consider a code coverage reporting solution that operates exclusively within your local environment. One such solution is go-test-coverage, which ensures that all coverage-related processes remain under your direct control and supervision. This approach guarantees that sensitive information about your source code remains confidential and safeguarded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment