diff --git a/.github/codeql/codeql-config.yml b/.github/codeql/codeql-config.yml new file mode 100644 index 0000000000..9478ac27a7 --- /dev/null +++ b/.github/codeql/codeql-config.yml @@ -0,0 +1,17 @@ +name: "Skip CodeQL config" + +queries: + - uses: security-extended + +# The C runtime is a local CLI: the only cpp/path-injection hits are +# sk_create_mapping/sk_load_mapping opening the state.db path passed via the +# process's own --data/--init argv (skiplang/prelude/runtime/palloc.c). The +# local user already controls the filesystem, so the rule is pure noise here. +query-filters: + - exclude: + id: cpp/path-injection + +# The examples are localhost-only demos, not shipped services, so +# js/missing-rate-limiting does not apply to them. +paths-ignore: + - "skipruntime-ts/examples/database-server.ts" diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml index d3107db944..fd201e65e4 100644 --- a/.github/workflows/codeql.yml +++ b/.github/workflows/codeql.yml @@ -67,7 +67,8 @@ jobs: with: languages: ${{ matrix.language }} build-mode: ${{ matrix.build-mode }} - queries: security-extended + # query suite and filters live in .github/codeql/codeql-config.yml + config-file: .github/codeql/codeql-config.yml - name: Build C runtime (manual c-cpp) if: matrix.language == 'c-cpp' diff --git a/.github/workflows/docker-publish-skdb.yml b/.github/workflows/docker-publish-skdb.yml index 0e87e05a6b..67aa118359 100644 --- a/.github/workflows/docker-publish-skdb.yml +++ b/.github/workflows/docker-publish-skdb.yml @@ -34,7 +34,7 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 - - uses: docker/setup-buildx-action@v4 + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 with: version: ${{ env.BUILDX_VERSION }} - name: Check the credentials can push skdb @@ -64,10 +64,10 @@ jobs: # The compiler is built from source in the image, and its Makefile # needs the pinned bootstrap and libbacktrace submodules. submodules: true - - uses: docker/setup-buildx-action@v4 + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 with: version: ${{ env.BUILDX_VERSION }} - - uses: docker/login-action@v4 + - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -76,7 +76,7 @@ jobs: run: df -h / - name: Build and push by digest id: bake - uses: docker/bake-action@v7 + uses: docker/bake-action@59cb1203cd42bcefd40a1b6d73b589e48c86040e # v7.5.0 with: # v6+ defaults to the git context, which would pick up neither the # submodules checked out above nor .dockerignore. @@ -129,13 +129,13 @@ jobs: path: /tmp/digests pattern: digest-* merge-multiple: true - - uses: docker/setup-buildx-action@v4 + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 with: # Load bearing: imagetools create runs from the CLI plugin this # installs, and it is what preserves or drops the per-platform # attestations. version: ${{ env.BUILDX_VERSION }} - - uses: docker/login-action@v4 + - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index 2d8ae66e6d..03b538839c 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -37,7 +37,7 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 - - uses: docker/setup-buildx-action@v4 + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 with: version: ${{ env.BUILDX_VERSION }} - name: Check every image CircleCI pulls is published @@ -52,7 +52,7 @@ jobs: runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v5 - - uses: docker/setup-buildx-action@v4 + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 with: version: ${{ env.BUILDX_VERSION }} - name: Check the credentials can push every published image @@ -83,10 +83,10 @@ jobs: # The compiler is built from source in the image, and its Makefile # needs the pinned bootstrap and libbacktrace submodules. submodules: true - - uses: docker/setup-buildx-action@v4 + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 with: version: ${{ env.BUILDX_VERSION }} - - uses: docker/login-action@v4 + - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} @@ -115,7 +115,7 @@ jobs: run: df -h / - name: Build and push by digest id: bake - uses: docker/bake-action@v7 + uses: docker/bake-action@59cb1203cd42bcefd40a1b6d73b589e48c86040e # v7.5.0 with: # v6+ defaults to the git context, which would pick up neither the # submodules checked out above nor .dockerignore. @@ -182,13 +182,13 @@ jobs: path: /tmp/meta pattern: metadata-* merge-multiple: true - - uses: docker/setup-buildx-action@v4 + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 with: # Load bearing here, not just in build: imagetools create runs from # the CLI plugin this installs, and it is what preserves or drops the # per-platform attestations. version: ${{ env.BUILDX_VERSION }} - - uses: docker/login-action@v4 + - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/.github/workflows/docker-retag-latest.yml b/.github/workflows/docker-retag-latest.yml index 04603ab8f8..7a91d36ad4 100644 --- a/.github/workflows/docker-retag-latest.yml +++ b/.github/workflows/docker-retag-latest.yml @@ -44,10 +44,10 @@ jobs: if: github.repository == 'SkipLabs/skip' runs-on: ubuntu-24.04 steps: - - uses: docker/setup-buildx-action@v4 + - uses: docker/setup-buildx-action@f87e5991a6d7451dcb8d9637bfbc97413f497069 # v4.4.1 with: version: ${{ env.BUILDX_VERSION }} - - uses: docker/login-action@v4 + - uses: docker/login-action@8aa5831fb8d48d8f76594c7ddde61ae58019f550 # v4.8.0 with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} diff --git a/sql/ts/src/skdb_worker.ts b/sql/ts/src/skdb_worker.ts index f8e693507f..2f8e852f58 100644 --- a/sql/ts/src/skdb_worker.ts +++ b/sql/ts/src/skdb_worker.ts @@ -49,6 +49,12 @@ const post = (message: any) => { }; const onMessage = (message: MessageEvent) => { + // The worker is only ever created same-origin from the embedding page + // (browser.ts: new Worker(new URL("./skdb_worker.js", import.meta.url))), + // so anything else is not a legitimate caller. + if (message.origin !== self.location.origin) { + return; + } /* eslint-disable-next-line @typescript-eslint/no-unsafe-argument */ onWorkerMessage(message.data, post, creator); };