{"id":41830417,"url":"https://github.com/cafjs/caf_security","last_synced_at":"2026-01-25T08:36:38.997Z","repository":{"id":6333972,"uuid":"7569536","full_name":"cafjs/caf_security","owner":"cafjs","description":"CAF security library","archived":false,"fork":false,"pushed_at":"2023-04-18T22:34:18.000Z","size":198,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-09-19T15:56:24.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/cafjs.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGES.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-2.0.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2013-01-12T00:21:11.000Z","updated_at":"2024-01-13T23:51:11.000Z","dependencies_parsed_at":"2023-01-13T13:56:45.426Z","dependency_job_id":null,"html_url":"https://github.com/cafjs/caf_security","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/cafjs/caf_security","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafjs%2Fcaf_security","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafjs%2Fcaf_security/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafjs%2Fcaf_security/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafjs%2Fcaf_security/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cafjs","download_url":"https://codeload.github.com/cafjs/caf_security/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cafjs%2Fcaf_security/sbom","scorecard":{"id":261782,"data":{"date":"2025-08-11","repo":{"name":"github.com/cafjs/caf_security","commit":"abfce8265bc9366582504a9510ef4c2b9d20de8a"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/push.yml:18: update your workflow using https://app.stepsecurity.io/secureworkflow/cafjs/caf_security/push.yml/master?enable=pin","Info:   0 out of   1 GitHub-owned GitHubAction dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: no topLevel permission defined: .github/workflows/push.yml:1","Info: no jobLevel write permissions found"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE-2.0.txt:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}}]},"last_synced_at":"2025-08-17T10:58:43.844Z","repository_id":6333972,"created_at":"2025-08-17T10:58:43.844Z","updated_at":"2025-08-17T10:58:43.844Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28749604,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T08:31:04.260Z","status":"ssl_error","status_checked_at":"2026-01-25T08:30:28.859Z","response_time":113,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-25T08:36:38.289Z","updated_at":"2026-01-25T08:36:38.984Z","avatar_url":"https://github.com/cafjs.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Caf.js\n\nCo-design cloud assistants with your web app and IoT devices.\n\nSee https://www.cafjs.com\n\n## Security Library\n\n[![Build Status](https://github.com/cafjs/caf_security/actions/workflows/push.yml/badge.svg)](https://github.com/cafjs/caf_security/actions/workflows/push.yml)\n\nThis repository contains a `Caf.js` library to add security checks.\n\nThe goal is to help application writers to support collaborative multi-tenancy within one app.\n\n`Caf.js` runs each application in a separate process, and the framework is under the control of the application writer. Therefore, the service provider, or other applications, should not trust those processes.\n\nAlso, we do not expect applications to run untrusted code in the Cloud. However, `Caf.js` tries very hard to minimize the impact of programming mistakes, such as trusting user input too much.\n\n### Naming\n\nIt's all in the name.\n\nBorrowing ideas from SDSI (Rivest\u0026Lampson'96), we use local namespaces that can be globally identified because the `owner` of the namespace has a unique name that we can authenticate. For example, the hash of a public key can be assumed to be unique, or a username in our `accounts` service, since this service also has a public/private key pair.\n\nAnd this allow us to **link** local namespaces in a robust manner. Similar to a symbolic link in a sensible file system, a name in a local namespace can refer to a named resource in a different local namespace.\n\nMoreover, a local name can refer to a group of resources, similar to referring to a sub-directory with symbolic links. Also, a resource could have many names, i.e., names become user-friendly tags that help us find resources.\n\nGiven a local name, how do we find its resources? By computing the transitive closure: start with local resources or referrals, both matching the target name; then, follow links, and keep adding reachable resources.\n\nWhat resources are registered in a `Caf.js` local namespace? **Everything**\n\n* CA:  using a  `caOwner-caLocalName` convention.\n* `SharedMap`: scoped by the CA that owns it, i.e.,\n`caOwner-caLocalName-mapLocalName`.\n* Private pub/sub channels: to enforce that only one CA can publish, i.e.,  `caOwner-caLocalName-channelLocalName`\n* Application: named after `appPublisher-appLocalName`.\n* ...\n\nTwo practical considerations:\n\n* We sometimes use resource names as hostnames and, we need to\nrestrict characters to ASCII letters (lower case) and numbers (see RFC 1123).\n\n* We can use the same `caLocalName` in different applications. Therefore, we\nmay need to qualify a CA name with its app name to make it globally unique. Since applications do not trust each other, this is rarely needed.\n\n### Authorization\n\nA core `Caf.js` abstraction is a trusted bus internal to an application. CAs interact with each other using this bus, and the bus guarantees that every request is authenticated by the source CA.\n\nThis allows the destination CA to grant or deny the request based on the method invoked and the caller. Also, application code has access to the caller's name, and it can impose extra requirements based on the call arguments.\n\n`Caf.js` naming helps us describe access policy. Explicit ownership in the name makes it easier to allow any CA from a trusted owner, or CAs with the same owner. Names naturally support groups, and by linking them, we can delegate the creation of a group to third parties. We can also group methods, further simplifying policy description.\n\nLinked local namespaces are implemented with `AggregateMaps` (see {@link external:caf_sharing/AggregateMap}) not with certificates as in SDSI. These distributed data structures can only be written by its owner, and the trusted bus that propagates updates to replicas enforces that property. This has important advantages:\n\n* Owners do not need to manage private keys.\n* Discovery is efficient, and transparently managed by the framework.\n* Revocation is fast (milliseconds).\n* Changes to an `AggregateMap` respect *Writer Atomicity*, *Readers Isolation*, *Fairness*, and monotonic read consistency (see {@link external:caf_sharing}), eliminating dangerous transients when policy changes.\n\n### Authentication\n\nA client always interacts with its CA using a mutually-authenticated secure channel. The challenge is how to provide single sign-on to multiple app CAs, when apps are not equally trusted. Client credentials used with one CA could be abused to access a more trusted CA.\n\nWe use JSON Web Tokens (JWT) signed by a third-party service, i.e., `accounts`,\nto weaken authentication credentials. Tokens can be scoped to a local name within an application. Local names could belong to other namespaces, federating authentication. A simple mechanism to weaken tokens enables a privileged CA to manage tokens on behalf of a client. See {@link module:caf_security/tokens}.\n\nPassword-based authentication with the `accounts` service is based on SRP. SRP derives a strong shared secret from a weak one, while being immune to man in the middle attacks. We use this strong secret to encrypt the JSON Web Token.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcafjs%2Fcaf_security","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcafjs%2Fcaf_security","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcafjs%2Fcaf_security/lists"}