github / github/codeql

Get full string for exported JavaScript results

オープン
#18,723 コメント 4 件 リアクション 0 件 担当者 0 名 GitHub で見る
question
主要言語
CodeQL
スター
10.1k
フォーク
2.1k
平均マージ
2日 15時間
マージ済み PR(30日)
141

説明

Consider the query below, which attempts to get the callee and the associated parameters. The returned string for the parameters is often truncated (sanitized) when the length is longer than 20 characters [as seen in the source code](https://github.com/github/codeql/blob/7361ad977a5dd5252d21f5fd23de47d75b763651/javascript/extractor/src/com/semmle/js/extractor/TextualExtractor.java#L121). For instance, if the expected full string is `bd0be325-86d9-4f16-95fa-b677f7455177`, it returns something like `bd0be ... 5177`, which is not helpful for my project.

While there's a good reason for this behavior, I would really like to be able to export the full string for a follow-up analysis.

```
import javascript

from CallExpr call, Expr parameters
where
parameters = call.getArgument(_)

select call.getCallee(), parameters.toString()
```

I have seen a similar issue ([results abbreviation #9890](https://github.com/github/codeql/issues/9890)), but the suggestions do not address my problem.

I would really appreciate any support I can get here. Thank you.

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

リンク先の行にある javascript/extractor/src/com/semmle/js/extractor/TextualExtractor.java から始め、parameters.toString() を使ってクエリを再現し、現在の切り詰めを確認します。エクスポートされた結果文字列がどのようにサニタイズされるかを追跡し、完全な文字列の出力に関連するカバレッジを特定します。クエリが現在の省略なしでパラメータ値全体をエクスポートでき、その動作が適切なテストまたは再現によって検証されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
javascript
領域
devtools
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
35/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。