LogDrop Taint for React Native
Taint data-flow analysis for React Native JavaScript and TypeScript source code
LogDrop Taint follows a value from a source—user input, a WebView message, a server response, or a constant in code—to a sink, and reports the values that arrive without being sanitised.
It also reports hardcoded credentials, unencrypted local storage, and unsafe WebView configuration.
The analyzer opens no network connection: not for licensing, usage counting, or telemetry. The licence is verified offline. Your repository is never uploaded, and by default the report carries no source code at all—only the rule, the file, and the line.
Snippets are off by default on React Native. The report contains the rule and file:line, and nothing of your code. Set snippets: "true" only if you want the offending line included.
The iOS, Android, and Flutter analyzers emit the same SARIF report shape. The .logdrop.json configuration and the signed suppressions format are shared; custom sinks use platform-specific rule ids and must match the analyzer that reads them.
GitHub Actions
The LogDrop Taint Action runs the scan as a step of a GitHub Actions workflow, here on every pull request. It reads your licence key from the repository secret LOGDROP_LICENSE.
name: Security scan
on: [pull_request]
jobs:
taint:
runs-on: ubuntu-latest # Linux. Node 20+ is all it needs.
permissions:
contents: read
security-events: write # only if you upload to Code Scanning
steps:
- uses: actions/checkout@v4
- uses: initialcodess/logdrop-taint-rn-action@v1
with:
license: ${{ secrets.LOGDROP_LICENSE }}
path: . # scan the repositoryThat is the whole minimum. Findings appear inline on the pull request and in the job summary, and the build stays green—see The scan is advisory.
Pin by commit SHA, not @v1
In a workflow, @v1 after the action's name is a tag that moves to each new 1.x release. A commit SHA names one fixed version of the action instead.
- uses: initialcodess/logdrop-taint-rn-action@a1b2c3d4...This action runs inside your CI with your source checked out. A moving tag means its owner decides what executes there, whenever they like. A SHA means you decide.
It also pins the checksum the installer verifies the analyzer against. That table lives inside the action, not beside the download, precisely so that replacing a release is not enough to change what runs on your machine.
@v1 is maintained and tracks the latest 1.x: the release flow moves it onto the commit that carries the pins, and the release gate fails unless @v1 and @vX.Y.Z name the same commit. It asks you to trust us continuously rather than once, which is a reasonable thing to choose—it should just be a choice rather than the only option shown.
gh api repos/initialcodess/logdrop-taint-rn-action/commits/v1 --jq .shaThe scan is advisory
fail-on defaults to never: findings are reported and the build stays green. This is a product decision, not an oversight. A scanner that breaks someone's pipeline on its own judgement gets removed from the pipeline.
Opt into a gate when you want one:
with:
license: ${{ secrets.LOGDROP_LICENSE }}
fail-on: high # critical | high | medium | low | neverReact Native and Flutter take a levelled fail-on. iOS and Android take a boolean fail-on-findings. The inputs are not interchangeable; a fail-on-findings: "true" on this action is an unrecognised input and gates nothing.
Run it without GitHub
Outside GitHub Actions, for example on another CI system or your own machine, run the analyzer directly. The analyzer is one self-contained JavaScript file. It needs no npm install, no node_modules, and none of your dependencies.
# Download and verify once; change the version when needed
V=v1.0.4
curl -fsSL -o install.sh \
"https://raw.githubusercontent.com/initialcodess/logdrop-taint-rn-action/$V/examples/install-logdrop-taint.sh"
chmod +x install.sh
LOGDROP_VERSION=$V LOGDROP_DIR="$HOME/logdrop" ./install.sh
# Run it. The installed file carries its version in the name, and the
# installer prints the full path it wrote.
export LOGDROP_LICENSE="LOGDROP...."
node "$HOME/logdrop/logdrop-taint-rn-$V.mjs" . \
--sarif report.sarif --fail-on highUse it in several environments:
- Developer machines: scan your own source before pushing.
- Build servers: add the commands to Jenkins, TeamCity, Bitrise, or any host with Node 20+. Exit code
1means findings at or above--fail-on. - Self-hosted runners: run the Action as-is.
The output is standard SARIF 2.1.0 and works with SARIF viewers or your own dashboard. The action repository's examples/ directory carries the same install-and-scan recipe for CircleCI, GitLab CI, Jenkins, and Bitrise—they all call examples/install-logdrop-taint.sh, so every system installs and verifies the analyzer the same way.
Where findings appear
All three views work on every GitHub plan:
- Pull request annotation: the finding appears above the relevant line in Files changed.
- Job summary: the run page shows a location, rule, and finding table.
- CI gate: with
fail-onset to a level, findings at or above it block the merge.
If Code Scanning is enabled, SARIF is uploaded there too. It is free for public repositories and depends on GitHub Code Security licensing for private ones. When upload is unavailable, the step warns and continues; it does not break the build.
Test code is skipped
Test fixtures are where fake credentials live, and in the code they are indistinguishable from real ones. Test files are excluded by default. Set include-tests: "true" to scan them.
What it finds
Twenty-one rules, from four engines. The ids carry the engine, because each asks a different question: TAINT asks whether a value reached a dangerous place, CONFIG asks whether a setting is unsafe, STRUCT asks whether the line itself is wrong, and LEAK asks whether an effect leaves a timer or subscription running.
Data flow
These rules follow an untrusted or sensitive value from where your code gets it to a place where it does harm, such as eval, a WebView, a file path, a log or the clipboard.
| Rule | CWE | What it reports |
|---|---|---|
RNJS-TAINT-UNTRUSTED-TO-INJECTED-JS | CWE-79 | An untrusted value reaches a WebView's injected JavaScript |
RNJS-TAINT-WEBVIEW-MESSAGE-TO-EVAL | CWE-95 | A WebView message reaches eval |
RNJS-TAINT-UNTRUSTED-TO-DYNAMIC-EVAL | CWE-95 | An untrusted value reaches eval or the Function constructor |
RNJS-TAINT-UNTRUSTED-TO-OPEN-URL | CWE-601 | An untrusted value reaches Linking.openURL |
RNJS-TAINT-UNTRUSTED-TO-FS-PATH | CWE-22 | An untrusted value reaches a filesystem path |
RNJS-TAINT-PII-LOG | CWE-532 | Personal data or a credential reaches a log call |
RNJS-TAINT-CREDENTIALS-LOCAL-STORE | CWE-312 | Personal data or a credential reaches unencrypted local storage |
RNJS-TAINT-CLIPBOARD | CWE-200 | Personal data or a credential is copied to the clipboard |
WebView and network configuration
A WebView shows web content inside your app. These rules check where a WebView may navigate and what its content may reach, whether requests use cleartext HTTP, and whether MMKV stores are encrypted.
| Rule | CWE | What it reports |
|---|---|---|
RNJS-CONFIG-WEBVIEW-ORIGIN-WILDCARD | CWE-942 | The WebView accepts navigation to any origin |
RNJS-CONFIG-WEBVIEW-NAVIGATION-GUARD | CWE-1021 | The WebView has no effective navigation guard |
RNJS-CONFIG-WEBVIEW-WINDOW-ESCAPE | CWE-1021 | The WebView allows an iframe to escape the top-layer DOM |
RNJS-CONFIG-WEBVIEW-FILE-ACCESS | CWE-200 | The WebView is allowed to read local files |
RNJS-CONFIG-WEBVIEW-MIXED-CONTENT | CWE-319 | The WebView allows cleartext subresources on an https page |
RNJS-CONFIG-WEBVIEW-INLINE-HTML | CWE-942 | The WebView renders inline HTML, so its origin whitelist cannot apply |
RNJS-CONFIG-CLEARTEXT-TRAFFIC | CWE-319 | A request is sent over cleartext HTTP |
RNJS-CONFIG-MMKV-UNENCRYPTED | CWE-312 | An MMKV store is created without an encryption key |
The line itself
These rules look at one line on its own, with no flow to follow: a credential written into the source, into unencrypted storage or into the log.
| Rule | CWE | What it reports |
|---|---|---|
RNJS-STRUCT-HARDCODED-CREDENTIAL | CWE-798 | A credential is hardcoded in the source |
RNJS-STRUCT-CREDENTIAL-NAMED-LITERAL | CWE-798 | A credential-named constant holds a hardcoded key |
RNJS-STRUCT-CREDENTIALS-LOCAL-STORE | CWE-312 | A credential is written to unencrypted storage |
RNJS-STRUCT-PII-LOG | CWE-532 | A credential is written to the log |
Lifetime
This rule finds React effects that start a timer or a subscription and never clean it up, so it can keep running after the component that started it is gone.
| Rule | CWE | What it reports |
|---|---|---|
RNJS-LEAK-EFFECT-NO-CLEANUP | CWE-401 | An effect creates a timer or subscription and never cleans it up |
The leak engine is off by default (leaks: "false"). While it is off, its rule does not run and does not appear in the report's rule list—so a report says "was not asked" rather than "loaded, found nothing".
Send reports to the LogDrop panel
Panel reporting is optional and off by default. Enable it to track findings over time, view binary and source scans for the same app together, and carry false-positive decisions across scans.
- uses: initialcodess/logdrop-taint-rn-action@v1
with:
license: ${{ secrets.LOGDROP_LICENSE }}
bundle-id: com.company.app
panel-url: https://analyze.logdrop.ioSending requires panel-url, license, and bundle-id together. Without all three, nothing is sent. The bundle id must be registered for the project; an unknown id is rejected so a typo cannot fail silently.
The analyzer itself still contacts nothing—sending is a separate step that authenticates with the licence and uploads the SARIF with the bundle id, app name, version/ref, and commit metadata used to group the report. With snippets off, which is the default here, the report carries no source line at all.
A panel that is down, a licence moved between projects, or a bundle id deleted in the panel will warn rather than fail your build—none of them is something the developer who opened the pull request can fix. Set fail-on-delivery-error: "true" if you would rather know loudly.
Adapt it to your codebase
Use this when your code has its own sources or sinks that the analyzer cannot know, for example a logging wrapper. A JSON file extends the source and sink model with your own entries:
with:
config: .logdrop.jsonA malformed configuration is refused out loud with exit code 3, rather than being silently ignored.
Silence a reviewed finding
Suppress a finding when you have reviewed it and it is not a problem in its context. A suppression records that decision in a file that LogDrop signs and the analyzer verifies.
Judge the finding in the panel and export the signed suppressions file:
with:
suppressions: .logdrop-suppressions.jsonA suppressed finding stays in the report, marked, and stops failing the gate—it is never silently removed. A file that does not verify, or that has expired, is refused out loud and everything is reported.
Inputs
Inputs are the with: settings of the Action step. Only license is required; bundle-id is also required once you set panel-url.
| Input | Default | What it does |
|---|---|---|
license | (required) | Your licence key. Keep it in a repository secret; it is verified offline. |
path | . | Directory to scan. |
repo-root | ${{ github.workspace }} | Root that SARIF paths are relative to. |
sarif-file | logdrop-taint.sarif | Where to write the report. |
fail-on | never | critical / high / medium / low / never. |
annotations | true | Inline boxes on the pull request. Works on every plan. |
upload-sarif | true | Upload to Code Scanning; warns and continues if it is off. |
include-tests | false | Scan test code too. |
leaks | false | Also report effects that start a timer or subscription and never clean it up. |
snippets | false | Put the offending source line in the report. |
config | — | JSON file extending the source/sink model with your own entries. |
suppressions | — | Signed suppressions file exported from the panel. |
panel-url | — | Send the report to the panel. Empty means nothing is sent. |
bundle-id | — | Required when panel-url is set. |
require-pinned-checksum | false | Refuse an analyzer version this action has no checksum for. |
fail-on-delivery-error | false | Fail the build when the report could not be sent. |
analyzer-version | v1.0.4 | Which analyzer to download. |
Outputs
Outputs are values the Action step sets for later steps of the same job.
| Output | What it is |
|---|---|
sarif-file | Path of the report that was written. |
findings | How many findings were reported. |
report-id | The id the panel filed the report under. Empty when nothing was sent. |
Exit codes
The analyzer ends with one of these codes. Use them in CI to tell findings apart from a licence or setup problem.
| Code | Meaning |
|---|---|
0 | Clean |
1 | Findings at or above fail-on |
2 | Licence failure |
3 | Bad arguments or configuration |
4 | The scan could not complete |
They are kept distinct on purpose: a developer whose licence lapsed must never be told their code has a vulnerability. A licence that cannot be verified stops the scan with 2—it does not fall back to scanning without one.
Requirements and licence
Node 20 or newer on the runner; ubuntu-latest has it. No npm install, no node_modules, and none of your dependencies are needed.
A licence is required and is verified offline—the analyzer makes no network call to check it. Without a valid licence the scan refuses to run and exits 2.
Repository: initialcodess/logdrop-taint-rn-action
Questions: destek@initialcode.io
.png)