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: Add view-component-input threat model #18466

Open
wants to merge 10 commits into
base: main
Choose a base branch
from

Conversation

asgerf
Copy link
Contributor

@asgerf asgerf commented Jan 10, 2025

We sometimes get requests from users to treat React props, Vue props, or Angular inputs as taint sources. Such inputs are not true taint sources however, and tend to generate many false positives in practice if used as taint sources. These inputs are akin to function parameters in that they just hold whatever values are passed in at the component's instantiation site.

As a middle ground, this PR adds a new threat model kind called view-component-input. When enabled, React props, Vue props, and Angular2 inputs are seen as taint sources.

Also adds a new meta-query to report changes to threat model sources other than remote.

Evaluations:

@github-actions github-actions bot added the JS label Jan 10, 2025
@asgerf asgerf force-pushed the js/view-component-inputs branch 3 times, most recently from ca410fe to f0fe3c1 Compare January 21, 2025 09:19
@asgerf asgerf force-pushed the js/view-component-inputs branch from f0fe3c1 to c329336 Compare January 22, 2025 08:51
@asgerf asgerf force-pushed the js/view-component-inputs branch from c329336 to 4161f45 Compare January 22, 2025 09:46
@asgerf asgerf marked this pull request as ready for review January 22, 2025 11:43
@Copilot Copilot bot review requested due to automatic review settings January 22, 2025 11:43
@asgerf asgerf requested a review from a team as a code owner January 22, 2025 11:43

Choose a reason for hiding this comment

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

Copilot reviewed 16 out of 34 changed files in this pull request and generated no comments.

Files not reviewed (18)
  • docs/codeql/reusables/threat-model-description.rst: Language not supported
  • javascript/ql/lib/semmle/javascript/Concepts.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/ViewComponentInput.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/frameworks/Angular2.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/frameworks/React.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/frameworks/Vue.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/security/dataflow/CommandInjectionCustomizations.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/security/dataflow/CorsMisconfigurationForCredentialsCustomizations.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/security/dataflow/LogInjectionQuery.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/security/dataflow/RegExpInjectionCustomizations.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/security/dataflow/RemoteFlowSources.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/security/dataflow/RequestForgeryCustomizations.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/security/dataflow/ResourceExhaustionCustomizations.qll: Language not supported
  • javascript/ql/lib/semmle/javascript/security/dataflow/TaintedPathCustomizations.qll: Language not supported
  • javascript/ql/src/meta/alerts/TaintSources.ql: Language not supported
  • javascript/ql/src/meta/alerts/ThreatModelSources.ql: Language not supported
  • javascript/ql/src/meta/internal/TaintMetrics.qll: Language not supported
  • javascript/ql/test/library-tests/frameworks/Angular2/test.expected: Language not supported

Tip: Copilot only keeps its highest confidence comments to reduce noise and keep you focused. Learn more

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant