|
1 |
| -/** Definitions related to the Apache Commons IO library. */ |
| 1 | +/** Definitions of taint steps in the IO framework */ |
2 | 2 |
|
3 | 3 | import java
|
4 | 4 | private import semmle.code.java.dataflow.ExternalFlow
|
5 | 5 |
|
6 |
| -// TODO: manual models that were not generated yet |
7 |
| -private class ApacheCommonsIOCustomSummaryCsv extends SummaryModelCsv { |
8 |
| - override predicate row(string row) { |
9 |
| - row = |
10 |
| - ["org.apache.commons.io;IOUtils;false;toBufferedInputStream;;;Argument[0];ReturnValue;taint"] |
11 |
| - } |
12 |
| -} |
13 |
| - |
14 |
| -private class ApacheCommonsIOSinksCsv extends SinkModelCsv { |
| 6 | +private class IOSinksCsv extends SinkModelCsv { |
15 | 7 | override predicate row(string row) {
|
16 | 8 | row =
|
17 | 9 | [
|
@@ -112,13 +104,17 @@ private class ApacheCommonsIOSinksCsv extends SinkModelCsv {
|
112 | 104 | }
|
113 | 105 | }
|
114 | 106 |
|
115 |
| -private class ApacheCommonsIOSourcesCsv extends SourceModelCsv { |
| 107 | +private class IOSourcesCsv extends SourceModelCsv { |
116 | 108 | override predicate row(string row) {
|
117 |
| - row = ["org.apache.commons.io;IOUtils;true;toByteArray;(URL);;ReturnValue;remote"] |
| 109 | + row = |
| 110 | + [ |
| 111 | + "org.apache.commons.io;IOUtils;true;resourceToByteArray;(String,ClassLoader);;ReturnValue;remote", |
| 112 | + "org.apache.commons.io;IOUtils;true;toByteArray;(URI);;ReturnValue;remote" |
| 113 | + ] |
118 | 114 | }
|
119 | 115 | }
|
120 | 116 |
|
121 |
| -private class ApacheCommonsIOSummaryCsv extends SummaryModelCsv { |
| 117 | +private class IOSummaryCsv extends SummaryModelCsv { |
122 | 118 | override predicate row(string row) {
|
123 | 119 | row =
|
124 | 120 | [
|
@@ -540,6 +536,8 @@ private class ApacheCommonsIOSummaryCsv extends SummaryModelCsv {
|
540 | 536 | "org.apache.commons.io;CopyUtils;true;copy;(Reader,Writer);;Argument[0];Argument[1];taint",
|
541 | 537 | "org.apache.commons.io;CopyUtils;true;copy;(String,Writer);;Argument[0];Argument[1];taint",
|
542 | 538 | "org.apache.commons.io;CopyUtils;true;copy;(byte[],OutputStream);;Argument[0];Argument[1];taint",
|
| 539 | + "org.apache.commons.io;CopyUtils;true;copy;(byte[],Writer);;Argument[0];Argument[1];taint", |
| 540 | + "org.apache.commons.io;CopyUtils;true;copy;(byte[],Writer,String);;Argument[0];Argument[1];taint", |
543 | 541 | "org.apache.commons.io;DirectoryWalker$CancelException;true;CancelException;(File,int);;Argument[0];Argument[-1];taint",
|
544 | 542 | "org.apache.commons.io;DirectoryWalker$CancelException;true;CancelException;(String,File,int);;Argument[1];Argument[-1];taint",
|
545 | 543 | "org.apache.commons.io;DirectoryWalker$CancelException;true;getFile;();;Argument[-1];ReturnValue;taint",
|
@@ -634,9 +632,11 @@ private class ApacheCommonsIOSummaryCsv extends SummaryModelCsv {
|
634 | 632 | "org.apache.commons.io;IOUtils;true;toBufferedReader;(Reader,int);;Argument[0];ReturnValue;taint",
|
635 | 633 | "org.apache.commons.io;IOUtils;true;toByteArray;(InputStream,int);;Argument[0];ReturnValue;taint",
|
636 | 634 | "org.apache.commons.io;IOUtils;true;toByteArray;(InputStream,long);;Argument[0];ReturnValue;taint",
|
637 |
| - "org.apache.commons.io;IOUtils;true;toByteArray;(Reader);;Argument[0];ReturnValue;taint", |
638 |
| - "org.apache.commons.io;IOUtils;true;toByteArray;(Reader,String);;Argument[0];ReturnValue;taint", |
639 | 635 | "org.apache.commons.io;IOUtils;true;toByteArray;(String);;Argument[0];ReturnValue;taint",
|
| 636 | + "org.apache.commons.io;IOUtils;true;toCharArray;(InputStream);;Argument[0];ReturnValue;taint", |
| 637 | + "org.apache.commons.io;IOUtils;true;toCharArray;(InputStream,Charset);;Argument[0];ReturnValue;taint", |
| 638 | + "org.apache.commons.io;IOUtils;true;toCharArray;(InputStream,String);;Argument[0];ReturnValue;taint", |
| 639 | + "org.apache.commons.io;IOUtils;true;toCharArray;(Reader);;Argument[0];ReturnValue;taint", |
640 | 640 | "org.apache.commons.io;IOUtils;true;toInputStream;(CharSequence);;Argument[0];ReturnValue;taint",
|
641 | 641 | "org.apache.commons.io;IOUtils;true;toInputStream;(CharSequence,Charset);;Argument[0];ReturnValue;taint",
|
642 | 642 | "org.apache.commons.io;IOUtils;true;toInputStream;(CharSequence,String);;Argument[0];ReturnValue;taint",
|
|
0 commit comments