• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Tatsh / wiswa / 26271312370
100%

Build:
DEFAULT BRANCH: master
Ran 22 May 2026 06:03AM UTC
Jobs 5
Files 16
Run time 1min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 May 2026 06:00AM UTC coverage: 100.0%. Remained the same
26271312370

push

github

Tatsh
tool.utils.postprocess: validate npm registry by hostname

The README badge generator previously gated the npmjs.com NPM Version /
NPM Downloads badges with
``publish_registry.startswith('https://registry.npmjs.org')``. A
spoofed `publishConfig.registry` such as
``https://registry.npmjs.org.evil.example/`` matched the prefix and
caused the generator to emit npmjs.com badges that linked to a wrong
(or attacker-chosen) package page.

Parse the registry URL with :py:func:`urllib.parse.urlparse` and check
``hostname == 'registry.npmjs.org'`` instead. Substring sanitisation on
URL strings is bypass-prone (CWE-20); hostname equality after parsing
is the recommended pattern.

Regression test:
``test_post_process_steps_badges_typescript_spoofed_registry_rejected``
asserts that the exact attack URL is rejected (no
``img.shields.io/npm/v/`` or ``img.shields.io/npm/dm/`` badges are
emitted). Blue-Army verified: stashing the fix makes the new test fail
with the buggy substring detected.

Fixes CodeQL alert
https://github.com/Tatsh/wiswa/security/code-scanning/4
(``py/incomplete-url-substring-sanitization``, CWE-20, high severity).

Signed-off-by: Andrew Udvare <audvare@gmail.com>

371 of 371 branches covered (100.0%)

Branch coverage included in aggregate %.

3 of 3 new or added lines in 1 file covered. (100.0%)

1944 of 1944 relevant lines covered (100.0%)

5.0 hits per line

Jobs
ID Job ID Ran Files Coverage
1 26271312370.1 22 May 2026 06:03AM UTC 16
100.0
GitHub Action Run
2 26271312370.2 22 May 2026 06:03AM UTC 16
100.0
GitHub Action Run
3 26271312370.3 22 May 2026 06:03AM UTC 16
100.0
GitHub Action Run
4 26271312370.4 22 May 2026 06:04AM UTC 16
100.0
GitHub Action Run
5 26271312370.5 22 May 2026 06:04AM UTC 16
100.0
GitHub Action Run
Source Files on build 26271312370
  • Tree
  • List 16
  • Changed 1
  • Source Changed 1
  • Coverage Changed 1
Coverage ∆ File Lines Relevant Covered Missed Hits/Line Branch Hits Branch Misses
  • Back to Repo
  • Github Actions Build #26271312370
  • 295fdda1 on github
  • Prev Build on master (#26270994017)
  • Next Build on master (#26271780966)
  • Delete
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc