Skip to content

docs: add security policy - #182

Merged
grunch merged 1 commit into
mainfrom
docs/add-security-policy
Aug 7, 2026
Merged

docs: add security policy#182
grunch merged 1 commit into
mainfrom
docs/add-security-policy

Conversation

@AndreaDiazCorreia

@AndreaDiazCorreia AndreaDiazCorreia commented Aug 6, 2026

Copy link
Copy Markdown
Member

Adds a SECURITY.md with the vulnerability reporting process for mostro-cli.

  • Private reporting via security@mostro.network
  • Supported version: 0.16.x
  • Coordinated disclosure with a 90-day limit
  • Scope focused on key material, message encryption and local storage; daemon issues are routed to MostroP2P/mostro

Summary by CodeRabbit

  • Documentation
    • Added a security policy outlining supported versions, vulnerability reporting, response timelines, coordinated disclosure, and issue scope.
    • Included security guidance for users and recognition for vulnerability reporters.

…lines

Establishes SECURITY.md with coordinated disclosure process, supported
versions table (0.16.x only), and private reporting via
security@mostro.network. Defines in-scope threats (mnemonic exposure, key
derivation flaws, message validation bypasses, insecure permissions) vs.
out-of-scope (daemon bugs, relay DoS, physical access). Includes response
targets (72h acknowledgement, 7d assessment, 30d fix), 90-day disclosure
window
@coderabbitai

coderabbitai Bot commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Walkthrough

Added SECURITY.md with a supported-version policy, private reporting process, coordinated disclosure rules, report scope, user security guidance, and reporter recognition policy.

Changes

Security Policy

Layer / File(s) Summary
Reporting and disclosure process
SECURITY.md
Defines support for the 0.16.x release line, private vulnerability reporting requirements, response targets, prioritization, and coordinated disclosure steps.
Report scope and security guidance
SECURITY.md
Defines in-scope and out-of-scope issues, protection guidance for key local configuration data, and reporter recognition rules.

Estimated code review effort: 1 (Trivial) | ~5 minutes

Poem

A rabbit found a policy bright,
With guarded keys and steps just right.
Reports hop in through private ways,
Fixes guide the release days.
Credits bloom when names are shown,
Safe paths lead the project home.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the addition of the security policy documentation.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch docs/add-security-policy

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 2b82dc5300

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread SECURITY.md
Comment on lines +54 to +55
Please do not disclose the issue publicly before a fix is released, unless we have
agreed otherwise.

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Reconcile the conflicting disclosure deadlines

When a confirmed issue remains unfixed after 90 days, step 4 permits public disclosure at the deadline, but this sentence still prohibits disclosure until a fix is released unless a separate agreement is reached. Reporters therefore cannot determine which condition governs; make the request explicitly preserve the stated 90-day limit.

Useful? React with 👍 / 👎.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🧹 Nitpick comments (1)
SECURITY.md (1)

21-29: 🔒 Security & Privacy | 🔵 Trivial | ⚡ Quick win

Provide an encrypted reporting option and require secret redaction.

The policy requests proof-of-concept code, logs, and configuration but does not require reporters to remove mnemonics, ADMIN_NSEC, tokens, or other secrets. It also provides no PGP key or secure upload path. Add an encrypted channel and require redaction or revocation of live credentials before submission.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SECURITY.md` around lines 21 - 29, Update the vulnerability reporting
guidance in SECURITY.md to provide an encrypted submission channel, such as a
maintained PGP public key or secure upload path, alongside
security@mostro.network. Add an explicit requirement that reporters redact
mnemonics, ADMIN_NSEC, tokens, and other secrets from proof-of-concept code,
logs, and configuration, or revoke any live credentials before submission.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@SECURITY.md`:
- Around line 46-55: Update the coordinated disclosure policy in SECURITY.md so
the 90-day milestone triggers a coordinated, risk-based disclosure review rather
than automatic public disclosure. Make clear that unresolved critical issues,
especially those affecting key material or funds, must not be disclosed publicly
without an available fix or explicit agreement, and align the reporter guidance
with this rule.
- Around line 61-62: Update the key-material scope in SECURITY.md to explicitly
include ADMIN_NSEC alongside the mnemonic, identity key, and derived trade keys,
preserving the existing scope wording and coverage.
- Around line 63-64: Update the SECURITY.md scope list to remove NIP-06 and
NIP-98 from the encryption, signing, or Nostr message validation entry, keeping
NIP-44 and NIP-59 there. Add separate scope entries identifying NIP-06 as
mnemonic-based key derivation and NIP-98 as HTTP authentication with signed
events.

---

Nitpick comments:
In `@SECURITY.md`:
- Around line 21-29: Update the vulnerability reporting guidance in SECURITY.md
to provide an encrypted submission channel, such as a maintained PGP public key
or secure upload path, alongside security@mostro.network. Add an explicit
requirement that reporters redact mnemonics, ADMIN_NSEC, tokens, and other
secrets from proof-of-concept code, logs, and configuration, or revoke any live
credentials before submission.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 8f7e395e-3746-43cb-91cc-43cfd189c59a

📥 Commits

Reviewing files that changed from the base of the PR and between 0db711c and 2b82dc5.

📒 Files selected for processing (1)
  • SECURITY.md

Comment thread SECURITY.md
Comment on lines +46 to +55
We follow coordinated disclosure:

1. You report the issue privately by email.
2. We confirm the issue and work on a fix.
3. A patched release is published and users are notified.
4. Details are disclosed publicly once a fix is available, or after 90 days from the
initial report, whichever comes first.

Please do not disclose the issue publicly before a fix is released, unless we have
agreed otherwise.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Make 90-day disclosure conditional for unresolved critical issues.

Line 51 permits public disclosure after 90 days even when no fix exists. Line 54 asks reporters not to disclose before a fix. These rules conflict, and publishing details of an unfixed key-material or funds vulnerability can expose users.

Define the 90-day point as a coordinated, risk-based disclosure review. Do not automatically publish details for unresolved critical issues.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SECURITY.md` around lines 46 - 55, Update the coordinated disclosure policy
in SECURITY.md so the 90-day milestone triggers a coordinated, risk-based
disclosure review rather than automatic public disclosure. Make clear that
unresolved critical issues, especially those affecting key material or funds,
must not be disclosed publicly without an available fix or explicit agreement,
and align the reporter guidance with this rule.

Comment thread SECURITY.md
Comment on lines +61 to +62
- Exposure or leakage of the mnemonic, identity key or derived trade keys.
- Weaknesses in key derivation, storage or database encryption.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Include ADMIN_NSEC in the key-material scope.

README.md documents ADMIN_NSEC as a separate private key for admin and solver commands. Line 87 also states that it grants administrative capabilities. The scope currently lists only the mnemonic, identity key, and derived trade keys.

Add ADMIN_NSEC explicitly so client-side leaks are not treated as out of scope.

Proposed wording
-- Exposure or leakage of the mnemonic, identity key or derived trade keys.
+- Exposure or leakage of the mnemonic, identity key, derived trade keys, or `ADMIN_NSEC`.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Exposure or leakage of the mnemonic, identity key or derived trade keys.
- Weaknesses in key derivation, storage or database encryption.
- Exposure or leakage of the mnemonic, identity key, derived trade keys, or `ADMIN_NSEC`.
- Weaknesses in key derivation, storage or database encryption.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SECURITY.md` around lines 61 - 62, Update the key-material scope in
SECURITY.md to explicitly include ADMIN_NSEC alongside the mnemonic, identity
key, and derived trade keys, preserving the existing scope wording and coverage.

Comment thread SECURITY.md
Comment on lines +63 to +64
- Flaws in the encryption, signing or validation of Nostr messages
(NIP-06, NIP-44, NIP-59, NIP-98).

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🔒 Security & Privacy | 🟡 Minor | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf 'SECURITY.md around vulnerability scope:\n'
sed -n '50,75p' SECURITY.md

printf '\nAll NIP mentions in SECURITY.md:\n'
rg -n 'NIP-[0-9]+' SECURITY.md || true

Repository: MostroP2P/mostro-cli

Length of output: 1420


🌐 Web query:

Nostr NIP-06 NIP-44 NIP-59 NIP-98 definition key derivation encryption signing validation HTTP authentication

💡 Result:

The requested Nostr Implementation Proposals (NIPs) define key management, encryption, privacy, and authentication standards for the protocol: NIP-06: Basic Key Derivation NIP-06 defines how to derive Nostr key pairs from mnemonic seed phrases [1][2]. It utilizes BIP-39 to generate the mnemonic seed and BIP-32 to derive keys using the path m/44'/1237'/0'/0/0, ensuring compatibility across different clients [1][3]. NIP-44: Versioned Encrypted Payloads NIP-44 provides a modern, versioned standard for end-to-end encryption, intended to replace the older NIP-04 [4]. Key features include: - Algorithms: Uses secp256k1 ECDH for key exchange, HKDF-SHA256 for key derivation, and ChaCha20-Poly1305 for authenticated encryption [5][4]. - Security: Adds message padding (to hide exact length) and utilizes nonces and version bytes to prevent security flaws found in earlier standards (e.g., chosen plaintext attacks) [4][6][7]. NIP-59: Gift Wrap Privacy Protocol NIP-59 defines a protocol to encapsulate events to protect metadata and provide sender privacy [8][9]. It uses three hierarchical concepts: - Rumor: An unsigned event containing the message content [8][10]. - Seal (Kind 13): A rumor encrypted (via NIP-44) and signed by the real sender's key [9][10]. - Gift Wrap (Kind 1059): The seal is encrypted again and wrapped in an event signed by a random, ephemeral key [8][10]. This hides the real author's identity from relays, which only see the ephemeral key and the recipient's information [9][10]. NIP-98: HTTP Authentication NIP-98 defines a method to authenticate HTTP requests using signed Nostr events [11][12]. - Mechanism: Clients create an ephemeral Kind 27235 event containing the target HTTP URL, the method (e.g., GET, POST), and an optional SHA-256 hash of the request body in a payload tag [12][13][14]. - Header: The client base64-encodes this signed event and sends it in the HTTP Authorization header as: Authorization: Nostr [11][14]. - Validation: Servers verify the signature, that the kind is 27235, and that the URL, method, and timestamp (typically within a 60-second window) match the request [12][13].

Citations:


Correct the NIP classifications in the scope list.

NIP-06 covers mnemonic-based key derivation, and NIP-98 covers HTTP authentication with signed events; they do not belong under encryption, signing, or Nostr message validation. Keep NIP-44 and NIP-59 as encrypted or wrapped messaging, and list NIP-06 and NIP-98 separately.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@SECURITY.md` around lines 63 - 64, Update the SECURITY.md scope list to
remove NIP-06 and NIP-98 from the encryption, signing, or Nostr message
validation entry, keeping NIP-44 and NIP-59 there. Add separate scope entries
identifying NIP-06 as mnemonic-based key derivation and NIP-98 as HTTP
authentication with signed events.

@grunch
grunch merged commit 89ae021 into main Aug 7, 2026
1 check passed
@grunch
grunch deleted the docs/add-security-policy branch August 7, 2026 21:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants