New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

sourcecrumbs

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sourcecrumbs

Make npm provenance attestation a bit more code bound

latest
Source
npmnpm
Version
0.0.2
Version published
Weekly downloads
2
Maintainers
1
Weekly downloads
 
Created
Source

sourcecrumbs

Maintainability Test Coverage

Make npm provenance attestation a bit more code bound

Concept

The provenance attestation is established by publicly providing a link to a package's source code and build instructions from the build environment. This allows developers to verify where and how your package was built before they download it.

This allows, so let's try to implement a working draft. Suppose we have published a package with sourcemaps and provenance telemetry in its packument. We could try:

  • compare file by file pkg inners with the bound repo commit.
  • match sourcemap data with the referenced git hosted sources via sourcemap-validator.
  • verify that pkg target (bundle, dist, whatever) corresponds its sources somehow. Hmm... This may require heuristics, unminification, AST comparison or something like that.

Usage

import {track} from '@qiwi/sourcecrumbs'

const result = await track({
  name: 'toposource',
  version: '1.1.4',
  registry: 'https://registry.npmjs.org'
})
// →
result = {
  meta: {
    pkgRef: {
      name: 'toposource',
      version: '1.1.4',
      registry: 'https://registry.npmjs.org'
    },
    repoRef: {
      type: 'git',
      url: 'git+https://github.com/semrel-extra/toposource.git',
      hash: 'b4f56f4ce75460c670363457821c054ed4db8464',
    }
  },
  tracks: {
    'package.json': {
      source: {
        refs: ['package.json'],
        coherence: 0.9995309568480301
      },
      sourcemap: null
    },
    'target/cjs/index.js': {
      source: null,
      sourcemap: {
        refs: [
          'src/main/ts/index.ts',
          'src/main/ts/toposource.ts'
        ],
        checks: {
          valid: true
        },
        coherence: null
      }
    },
    // ...
  }
}

Refs

Licence

MIT

Keywords

sourcecrumbs

FAQs

Package last updated on 10 May 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts