#1789·airweave

Best-practice: dev.integrations.yaml policy question + workflow inputs handling + monke wildcard CORS + Dockerfile USER

Author: elfrostCreated May 19, 2026Updated May 19, 2026

Hi airweave team,

While testing AI PatchLab (an open-source local-first SAST/SCA scanner) on a few mid-popularity Python AI projects, I scanned airweave at `a9c8b1af722d` and wanted to flag four best-practice items. Filing as a single courtesy issue.

A separate finding was reported privately via the email channel listed in your `SECURITY.md` ([email protected]).

Full curated write-up — including the FP analysis and the SQL identifier-interpolation class we've now seen on three independent codebases — is at: https://elfrost.github.io/ai-patchlab/scans/airweave-ai-airweave.html

1. `backend/airweave/platform/auth/yaml/dev.integrations.yaml` — dev OAuth secrets policy question

13 OAuth `client_id` + `client_secret` pairs for integrated providers (Airtable, Asana, Box, Confluence, Notion, …) are committed under a clearly-authored warning:

```yaml

Warning: this file is not used in production. It is only used for development.

The secrets that we openly share with you are for development purposes only and cannot

be used in production.

```

The intent is to spare local developers from registering their own OAuth apps — a real friction-reduction. But this is the first scan in our series that's hit this pattern, so a couple of items might be worth a fresh check:

  • Per-provider terms-of-service. Some OAuth providers explicitly forbid sharing client secrets even "dev-only" — Atlassian, Box, Asana, Notion each have their own posture. An audit-friendly path is a per-provider verification (or an internal note in the file linking each entry to the relevant ToS clause) that the dev credentials are actually allowed to be committed in a public repo.
  • OAuth client secrets identify the application, not the user. A bad actor running a phishing flow against an airweave user using the committed `client_id` looks (to the OAuth provider) like a legitimate airweave OAuth request. The "dev only" disclaimer doesn't change the application identity on the provider side.
  • The shipped credentials are likely to age. Provider key rotation, refresh-token expiry, scope changes — any new contributor who relies on this file is one rotation away from a confusing error. A `.example.yaml` with `` placeholders + an interactive setup script gives the same friction-removal without the long-tail risk.

This is genuinely a discussion item, not an exploit. Apologies if you've already covered this internally; the courtesy is to raise the check.

2. 8× workflow `${{ ... }}` interpolation in `run:` blocks

`.github/workflows/code-quality.yml:59, 107`, `publish-sdks-and-mcp.yml:71, 77, 106, 122`, and two others. Same class as the items resolved on gptme PR #2399 and PraisonAI PR #1677. The fix template from either of those PRs transfers directly:

```yaml

Before

  • run: | poetry run diff-quality --compare-branch=origin/${{ github.base_ref }} ...

After

  • env: BASE_REF: ${{ github.base_ref }} run: | poetry run diff-quality --compare-branch="origin/$BASE_REF" ... ```

Realistic exploit window for `github.base_ref` is narrow (GitHub-controlled), but the fix removes the class and matches GitHub's own security hardening guidance.

3. `monke/backend/app.py:12` — wildcard CORS

```python app.add_middleware( CORSMiddleware, allow_origins=[""], allow_methods=[""], allow_headers=["*"], ) ```

If `monke` is purely local-dev tooling the risk is contained. If it's ever exposed (e.g. inside a docker-compose dev cluster reachable from a browser tab on a different origin), enumerating allowed origins is the simple fix. `allow_credentials` is not set, so the worst case isn't credentialed cross-origin — but the intent of "any origin may call this server" is still loose.

4. 4× Dockerfiles missing `USER` directive

`connect/Dockerfile:39`, `frontend/Dockerfile:38`, `monke/Dockerfile:29`, `monke/frontend/Dockerfile:15` all end without a `USER` directive, so the containerized service runs as root. Standard hardening:

```dockerfile RUN groupadd -r app && useradd -r -g app -d /app app USER app ENTRYPOINT ["..."] ```

Lower-impact for static-serving frontends; mechanical fix in all cases.

5. `text(f"...")` / `asyncpg-sqli` at 3 sites — same identifier-interpolation class as Upsonic and PraisonAI

`backend/airweave/crud/crud_usage.py:129` and `backend/airweave/platform/sources/ctti.py:268`. Same pattern documented previously — gated by config today, but SQLAlchemy's `quoted_name()` / asyncpg's identifier-escaping is the defensible pattern for any value interpolated into a SQL identifier.


Happy to open separate PRs for any of these. None blocks anything. Thanks for airweave — the rest of the scan was full of FPs that confirm the codebase is well-defended (the `ya29.a0AfH6SMBxxxxxxxxxx` Google OAuth token in `examples.py:205` is an obvious doc placeholder, the SHA1 in `sharepoint_online/source.py:1600` is a non-crypto stable identifier, the vite.config.ts `path-join` findings are build tooling, etc.). The write-up walks through them.