Skip to content

Security Policy

This document describes security considerations for PTA Standards and how to report security issues.

Scope

Security considerations for PTA Standards include:

  1. Specification Security - Security implications of specified behaviors
  2. Reference Implementation - Build tools and test harness
  3. Documentation - Preventing misleading security guidance

Security Considerations in Specifications

Parser Security

Implementations should be aware of:

RiskDescriptionMitigation
DoS via complex inputDeeply nested structures, long linesImpose limits
Path traversalinclude directives with ../Validate paths
Unicode issuesHomoglyph attacks, RTL overrideNormalize input
Memory exhaustionVery large filesStream processing

Data Security

RiskDescriptionMitigation
Sensitive data exposureAccount numbers, balancesEncryption at rest
Injection attacksMetadata in external systemsSanitize output
Information leakageError messages reveal pathsGeneric errors

Include File Security

The include directive poses risks:

beancount
; Potentially dangerous
include "/etc/passwd"           ; Absolute paths outside project
include "../../../secret.bean"  ; Path traversal
include "https://evil.com/x"    ; Remote includes (if supported)

Recommendations for implementations:

  1. Restrict includes to project directory
  2. Disallow absolute paths by default
  3. Require explicit opt-in for remote includes
  4. Validate paths before opening

Reporting Security Issues

For Specification Issues

If you find a security issue in the specification itself:

  1. Do NOT open a public issue
  2. Open a GitHub Security Advisory (private)
  3. Include:
    • Description of the issue
    • Potential impact
    • Suggested fix (if any)

For Implementation Issues

Security issues in specific implementations should be reported to those projects directly. This specification project is not responsible for implementation security.

For Build Tool Issues

Security issues in our build tools and test harness:

  1. Open a GitHub Security Advisory
  2. Or contact maintainers directly

Response Timeline

StageTimeline
Acknowledgment48 hours
Initial assessment1 week
Fix development2-4 weeks
DisclosureAfter fix, or 90 days

Disclosure Policy

We follow coordinated disclosure:

  1. Reporter notifies us privately
  2. We assess and develop fix
  3. We coordinate disclosure timing with reporter
  4. Public disclosure after fix is available

Credit is given to reporters unless they prefer anonymity.

Security Updates

Security-related specification changes are:

  1. Marked clearly in changelog
  2. Announced via security mailing list
  3. Given expedited review when needed

Best Practices for Implementations

We recommend implementations:

Input Validation

- Limit maximum file size
- Limit maximum line length
- Limit include depth
- Limit directive count
- Timeout on parsing

Path Handling

- Canonicalize paths
- Check for traversal attempts
- Restrict to allowed directories
- Use allowlists over denylists

Error Handling

- Avoid exposing full file paths
- Sanitize user input in errors
- Log security events
- Fail securely

Dependency Security

- Keep dependencies updated
- Audit dependency trees
- Use lockfiles
- Monitor for CVEs
SectionSecurity Relevance
include directivePath traversal, remote includes
plugin directiveCode execution
Metadata fieldsInjection if exported
Account namesUnicode normalization
Decimal handlingPrecision attacks

Threat Model

In Scope

  • Malicious input files
  • Malicious include targets
  • Resource exhaustion
  • Information disclosure

Out of Scope

  • Compromised development environment
  • Physical access attacks
  • Social engineering
  • Network attacks (unless remote includes)

Resources

Changelog

DateChange
2024-XX-XXInitial security policy