Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

JS: Initial models-as-data implementation #7171

Draft
wants to merge 4 commits into
base: main
Choose a base branch
from
Draft

Conversation

@asgerf
Copy link
Contributor

@asgerf asgerf commented Nov 18, 2021

Initial implementation of models-as-data. Please use the backlinked issue for high-level discussion of the format itself.

The implementation is split in three files:

  • Shared.qll is intended to be shared between languages (some day; currently only works for JS)
  • Impl.qll is intended to contain the langauge-specific details.
  • ModelsAsData.qll is the public interface from the rest of the library

Some predicates from Shared.qll must be usable from Impl.qll, but should not be public in the library, so ModelsAsData.qll acts as a gatekeeper toward the public API.

The API exposes two modules:

  • ModelInput is used for contributing models
    • For example, subclass ModelInput::SinkModelCsv to add new sinks
  • ModelOutput is used for accessing interpreted models in terms of API nodes
    • For example, use ModelOutput::getASinkNode("sql-injection") to get SQL injection sinks

In this PR I have ported Sequelize and Spanner, as initial validation.

Evaluation from a slightly earlier version.

  • The new result is due to MaD always using API graphs whereas the old model used local flow for credentials.
  • (The new taint sources were due to the inclusion of an rough Express MaD model in the earlier version. They only show up in the diff because getSourceType() returned a different string for those source, not because they were truly new)
@asgerf asgerf added the JS label Nov 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

1 participant