Inna Dubchak

40 papers A 4Misc 2Journal 31Unranked 3
YearRankTypeTitle / Venue / Authors
2017 J jnl
Nucleic Acids Res.
Locedie Mansueto, Roven Rommel Fuentes, Frances Nikki Borja, Jeffery Detras, Juan Miguel Abriol-Santos, Dmytro Chebotarov, Millicent Sanciangco, Kevin Palis, Dario Copetti, Alexandre Poliakov, Inna Dubchak, Victor V. Solovyev, Rod A. Wing, Ruaraidh Sackville Hamilton, Ramil Mauleon, Kenneth L. McNally, Nickolai Alexandrov
2015 J jnl
BMC Bioinform.
Michael Cantor, Henrik Nordberg, Tatyana Smirnova, Matthias Hess, Susannah Tringe, Inna Dubchak
2014 J jnl
Bioinform.
Alexander Poliakov, Justin Foong, Michael Brudno, Inna Dubchak
2014 J jnl
Nucleic Acids Res.
Igor V. Grigoriev, Roman Nikitin, Sajeet Haridas, Alan Kuo, Robin A. Ohm, Robert Otillar, Robert Riley, Asaf A. Salamov, Xueling Zhao, Frank Korzeniewski, Tatyana Smirnova, Henrik Nordberg, Inna Dubchak, Igor Shabalov
2014 J jnl
Nucleic Acids Res.
Henrik Nordberg, Michael Cantor, Serge Dusheyko, Susan Hua, Alexander Poliakov, Igor Shabalov, Tatyana Smirnova, Igor V. Grigoriev, Inna Dubchak
2013 J jnl
Bioinform.
Inna Dubchak, Matthew Munoz, Alexander Poliakov, Nathan Salomonis, Simon Minovitsky, Rolf Bodmer, Alexander C. Zambon
2012 conf
BIOINFORMATICS
Elena D. Stavrovskaya, Andrey A. Mironov, Dmitry A. Rodionov, Inna Dubchak, Pavel S. Novichkov
2012 J jnl
Nucleic Acids Res.
Pavel S. Novichkov, Thomas S. Brettin, Elena S. Novichkova, Paramvir S. Dehal, Adam P. Arkin, Inna Dubchak, Dmitry A. Rodionov
2012 J jnl
Nucleic Acids Res.
Igor V. Grigoriev, Henrik Nordberg, Igor Shabalov, Andrea Aerts, Mike Cantor, David M. Goodstein, Alan Kuo, Simon Minovitsky, Roman Nikitin, Robin A. Ohm, Robert Otillar, Alexander Poliakov, Igor Ratnere, Robert Riley, Tatyana Smirnova, Daniel Rokhsar, Inna Dubchak
2011 J jnl
Bioinform.
Igor Lukashin, Pavel S. Novichkov, Dario Boffelli, Alex R. Paciorkowski, Simon Minovitsky, Song Yang, Inna Dubchak
2010 J jnl
Nucleic Acids Res.
Paramvir S. Dehal, Marcin P. Joachimiak, Morgan N. Price, John T. Bates, Jason K. Baumohl, Dylan Chivian, Greg D. Friedland, Katherine H. Huang, Keith Keller, Pavel S. Novichkov, Inna Dubchak, Eric J. Alm, Adam P. Arkin
2010 J jnl
Nucleic Acids Res.
Pavel S. Novichkov, Olga N. Laikova, Elena S. Novichkova, Mikhail S. Gelfand, Adam P. Arkin, Inna Dubchak, Dmitry A. Rodionov
2010 J jnl
Nucleic Acids Res.
Pavel S. Novichkov, Dmitry A. Rodionov, Elena D. Stavrovskaya, Elena S. Novichkova, Alexei E. Kazakov, Mikhail S. Gelfand, Adam P. Arkin, Andrey A. Mironov, Inna Dubchak
2009 J jnl
Nucleic Acids Res.
Pavel S. Novichkov, Igor Ratnere, Yuri I. Wolf, Eugene V. Koonin, Inna Dubchak
2008 J jnl
Nucleic Acids Res.
Victor M. Markowitz, Natalia Ivanova, Ernest Szeto, Krishna Palaniappan, Ken Chu, Daniel Dalevi, I-Min A. Chen, Yuri Grechkin, Inna Dubchak, Iain Anderson, Athanasios Lykidis, Konstantinos Mavrommatis, Philip Hugenholtz, Nikos Kyrpides
2008 J jnl
Nucleic Acids Res.
Victor M. Markowitz, Ernest Szeto, Krishna Palaniappan, Yuri Grechkin, Ken Chu, I-Min A. Chen, Inna Dubchak, Iain Anderson, Athanasios Lykidis, Konstantinos Mavrommatis, Natalia Ivanova, Nikos Kyrpides
2007 J jnl
Nucleic Acids Res.
Michael Brudno, Alexander Poliakov, Simon Minovitsky, Igor Ratnere, Inna Dubchak
2007 J jnl
Nucleic Acids Res.
Alexei E. Kazakov, Michael J. Cipriano, Pavel S. Novichkov, Simon Minovitsky, Dmitry V. Vinogradov, Adam P. Arkin, Andrey A. Mironov, Mikhail S. Gelfand, Inna Dubchak
2007 J jnl
Bioinform.
Shengyin Gu, Iain Anderson, Victor Kunin, Michael J. Cipriano, Simon Minovitsky, Gunther H. Weber, Nina Amenta, Bernd Hamann, Inna Dubchak
2007 J jnl
Nucleic Acids Res.
Axel Visel, Simon Minovitsky, Inna Dubchak, Len A. Pennacchio
2006 conf
ISMB (Supplement of Bioinformatics)
Victor M. Markowitz, Natalia Ivanova, Krishna Palaniappan, Ernest Szeto, Frank Korzeniewski, Athanasios Lykidis, Iain Anderson, Konstantinos Mavrommatis, Victor Kunin, Héctor García Martín, Inna Dubchak, Philip Hugenholtz, Nikos Kyrpides
2006 J jnl
Nucleic Acids Res.
Victor M. Markowitz, Frank Korzeniewski, Krishna Palaniappan, Ernest Szeto, Greg Werner, Anu Padki, Xueling Zhao, Inna Dubchak, Philip Hugenholtz, Iain Anderson, Athanasios Lykidis, Konstantinos Mavrommatis, Natalia Ivanova, Nikos Kyrpides
2005 J jnl
PLoS Comput. Biol.
Dmitry A. Rodionov, Inna Dubchak, Adam P. Arkin, Eric J. Alm, Mikhail S. Gelfand
2005 J jnl
BMC Bioinform.
Nameeta Y. Shah, Michael V. Teplitsky, Simon Minovitsky, Len A. Pennacchio, Philip Hugenholtz, Bernd Hamann, Inna Dubchak
2004 J jnl
Bioinform.
Nameeta Y. Shah, Olivier Couronne, Len A. Pennacchio, Michael Brudno, Serafim Batzoglou, E. Wes Bethel, Edward M. Rubin, Bernd Hamann, Inna Dubchak
2004 J jnl
Nucleic Acids Res.
Kelly A. Frazer, Lior Pachter, Alexander Poliakov, Edward M. Rubin, Inna Dubchak
2003 Misc conf
Pacific Symposium on Biocomputing
Liping Wei, Inna Dubchak, Victor V. Solovyev
2003 conf
ISMB (Supplement of Bioinformatics)
Michael Brudno, Sanket Malde, Alexander Poliakov, Chuong B. Do, Olivier Couronne, Inna Dubchak, Serafim Batzoglou
2002 J jnl
J. Biomed. Informatics
Liping Wei, Yueyi Liu, Inna Dubchak, John Shon, John Park
2002 Misc conf
Pacific Symposium on Biocomputing
Inna Dubchak, Lior Pachter, Liping Wei
2002 J jnl
Briefings Bioinform.
Inna Dubchak, Lior Pachter
2001 J jnl
Bioinform.
Chris H. Q. Ding, Inna Dubchak
2000 J jnl
Nucleic Acids Res.
I. Dralyuk, Michael Brudno, Mikhail S. Gelfand, Manfred Zorn, Inna Dubchak
2000 J jnl
J. Comput. Biol.
I. Saira Mian, Inna Dubchak
2000 J jnl
Bioinform.
Chris Mayor, Michael Brudno, Jody R. Schwartz, Alexander Poliakov, Edward M. Rubin, Kelly A. Frazer, Lior Pachter, Inna Dubchak
1999 J jnl
Nucleic Acids Res.
Mikhail S. Gelfand, Inna Dubchak, I. Dralyuk, Manfred Zorn
1999 A conf
ISMB
Poe Xing, Casimir A. Kulikowski, Ilya B. Muchnik, Inna Dubchak, Denise M. Wolf, Sylvia Spengler, Manfred Zorn
1997 A conf
ISMB
Inna Dubchak, Ilya B. Muchnik, Sung-Hou Kim
1995 A conf
ISMB
Eddy Mayoraz, Inna Dubchak, Ilya B. Muchnik
1993 A conf
ISMB
Inna Dubchak, Stephen R. Holbrook, Sung-Hou Kim
redb/extractors/js_extractors/js_xray.py
← Index redb/extractors/js_extractors/js_xray.py python
"""Subprocess wrapper for the bundled js-x-ray Node bridge.

Mirrors `js_deobfuscator.py`: shell out to a Node script with a per-sample
timeout, kill the process group on hang, demote `FileNotFoundError` to debug
(missing tool is routine — the host either has Node + the bundled package
installed or it doesn't), and return a structured result on success.

The bridge lives at `redb/extractors/js_extractors/scripts/js-xray-runner.js`.
Operators install the JS dependency once with `npm install` in that directory
(or override the path with `JS_XRAY_RUNNER_PATH`).

Configuration (env vars):
    JS_XRAY_RUNNER_PATH   Path to the Node bridge script (default: bundled).
    JS_XRAY_TIMEOUT       Seconds before the subprocess is killed. Default: 30.

`run(source, log)` returns `XRayResult(obfuscator, warnings)` on a successful
analysis, or `XRayResult(None, [])` for any non-success path (binary missing,
timeout, parse failure, etc.). The two unsuccessful states are
indistinguishable to the caller on purpose — they all collapse to "no
js-x-ray verdict, fall back to heuristic".
"""

from __future__ import annotations

import json
import os
import signal
import subprocess
import tempfile
from dataclasses import dataclass, field
from typing import List, Optional

# Bundled bridge: redb/extractors/js_extractors/scripts/js-xray-runner.js
_DEFAULT_RUNNER = os.path.join(
    os.path.dirname(__file__), "scripts", "js-xray-runner.js"
)
_DEFAULT_NODE = "node"
_DEFAULT_TIMEOUT_SECS = 30


@dataclass
class XRayResult:
    """Parsed js-x-ray output. `obfuscator` is the recognised family name
    (e.g. "jsfuck", "obfuscator.io") or None when js-x-ray did not flag the
    code. `warnings` carries every {kind, value} pair the analyser produced;
    the heuristic uses it as a corroborating signal. `avg_identifier_length`
    is js-x-ray's own AST-derived figure — used as a fallback for the
    heuristic's `avg_identifier_length<2` strong signal when pyjsparser
    can't parse the source (anything ES2015+ trips it)."""

    obfuscator: Optional[str] = None
    warnings: List[dict] = field(default_factory=list)
    avg_identifier_length: Optional[float] = None

    @property
    def flagged(self) -> bool:
        return self.obfuscator is not None


def _empty() -> XRayResult:
    return XRayResult(obfuscator=None, warnings=[])


def run(source: str, log) -> XRayResult:
    if not source:
        return _empty()

    runner = os.getenv("JS_XRAY_RUNNER_PATH", _DEFAULT_RUNNER)
    node_bin = os.getenv("JS_XRAY_NODE_BIN", _DEFAULT_NODE)
    timeout = int(os.getenv("JS_XRAY_TIMEOUT", str(_DEFAULT_TIMEOUT_SECS)))

    if not os.path.exists(runner):
        log.debug(f"js-x-ray runner not found at {runner}")
        return _empty()

    # Skip the subprocess entirely when the JS dependency isn't installed.
    # Without this, every call to a host that has `node` but never ran
    # `npm install` next to the runner would still fork node, get a require
    # error, and exit nonzero — wasted ~50–200ms per JS sample (and per test).
    runner_dir = os.path.dirname(runner)
    if not os.path.isdir(os.path.join(runner_dir, "node_modules", "@nodesecure", "js-x-ray")):
        log.debug(f"@nodesecure/js-x-ray not installed in {runner_dir}")
        return _empty()

    tmp_path = None
    try:
        with tempfile.NamedTemporaryFile(
            suffix=".js", mode="w", delete=False, encoding="utf-8"
        ) as tmp:
            tmp.write(source)
            tmp_path = tmp.name

        try:
            process = subprocess.Popen(
                [node_bin, runner, tmp_path],
                stdout=subprocess.PIPE,
                stderr=subprocess.PIPE,
                preexec_fn=os.setsid,
            )
            try:
                stdout, stderr = process.communicate(timeout=timeout)
            except subprocess.TimeoutExpired:
                # Kill the whole process group so any node helpers die too.
                try:
                    os.killpg(os.getpgid(process.pid), signal.SIGTERM)
                    process.wait(timeout=5)
                except Exception:
                    try:
                        os.killpg(os.getpgid(process.pid), signal.SIGKILL)
                    except Exception:
                        pass
                log.warning(f"js-x-ray timed out after {timeout}s")
                return _empty()

            if process.returncode != 0:
                err = stderr.decode("utf-8", errors="replace").strip()
                log.debug(f"js-x-ray exited {process.returncode}: {err}")
                return _empty()

            text = stdout.decode("utf-8", errors="replace").strip()
            if not text:
                return _empty()

            try:
                payload = json.loads(text)
            except json.JSONDecodeError as e:
                log.warning(f"js-x-ray emitted non-JSON output: {e}")
                return _empty()

            obfuscator = payload.get("obfuscator")
            warnings = payload.get("warnings") or []
            if not isinstance(warnings, list):
                warnings = []

            ids_avg = payload.get("idsLengthAvg")
            if not isinstance(ids_avg, (int, float)):
                ids_avg = None

            return XRayResult(
                obfuscator=obfuscator,
                warnings=warnings,
                avg_identifier_length=ids_avg,
            )
        finally:
            if tmp_path:
                try:
                    os.unlink(tmp_path)
                except Exception:
                    pass
    except FileNotFoundError:
        log.debug(f"node binary not found at {node_bin}")
        return _empty()
    except Exception as e:
        log.error(f"js-x-ray subprocess error: {e}")
        return _empty()